blob: 58e4aba01d5bb25d8eb42ec03f69ce7732de1a28 [file] [log] [blame]
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
namespace remoting {
// Class for capturing logs in memory before printing out.
class InMemoryLogHandler {
InMemoryLogHandler() = delete;
InMemoryLogHandler(const InMemoryLogHandler&) = delete;
InMemoryLogHandler& operator=(const InMemoryLogHandler&) = delete;
// Registers the log handler. This is not thread safe and should be called
// exactly once in the main function.
static void Register();
// Returns most recently captured logs (#lines <= kMaxNumberOfLogs) since the
// app is launched. This must be called after Register() is called.
static std::string GetInMemoryLogs();
} // namespace remoting