blob: 018a290a1700426d9e7d9645623842746e649612 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// 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