init_logging.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef FUCHSIA_WEB_COMMON_INIT_LOGGING_H_
  5. #define FUCHSIA_WEB_COMMON_INIT_LOGGING_H_
  6. #include "base/strings/string_piece_forward.h"
  7. namespace base {
  8. class CommandLine;
  9. }
  10. // Configures logging for the current process based on the supplied
  11. // |command_line|. Returns false if a logging output stream could not
  12. // be created.
  13. bool InitLoggingFromCommandLine(const base::CommandLine& command_line);
  14. // Same as InitLoggingFromCommandLine but defaults to "stderr" if the logging
  15. // target is not specified.
  16. bool InitLoggingFromCommandLineDefaultingToStderrForTest(
  17. base::CommandLine* command_line);
  18. // Emits an INFO log indicating that |component_name| is starting along with the
  19. // version. Call during the startup of a Fuchsia Component (e.g., in main())
  20. // after InitLoggingFromCommandLine() succeeds.
  21. void LogComponentStartWithVersion(base::StringPiece component_name);
  22. #endif // FUCHSIA_WEB_COMMON_INIT_LOGGING_H_