Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: mojo/environment/default_logger_impl.cc

Issue 1765243002: Remove Mojo bindings environment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/environment/default_logger_impl.h ('k') | mojo/environment/default_run_loop_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/environment/default_logger_impl.cc
diff --git a/mojo/environment/default_logger_impl.cc b/mojo/environment/default_logger_impl.cc
deleted file mode 100644
index e1fda43be238799ef940af1b576431999a30fd8f..0000000000000000000000000000000000000000
--- a/mojo/environment/default_logger_impl.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2014 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 "mojo/environment/default_logger_impl.h"
-
-#include <stdint.h>
-
-#include "base/logging.h"
-#include "base/macros.h"
-
-namespace mojo {
-namespace internal {
-namespace {
-
-// We rely on log levels being the same numerically:
-static_assert(logging::LOG_VERBOSE == MOJO_LOG_LEVEL_VERBOSE,
- "verbose log level value mismatch");
-static_assert(logging::LOG_INFO == MOJO_LOG_LEVEL_INFO,
- "info log level value mismatch");
-static_assert(logging::LOG_WARNING == MOJO_LOG_LEVEL_WARNING,
- "warning log level value mismatch");
-static_assert(logging::LOG_ERROR == MOJO_LOG_LEVEL_ERROR,
- "error log level value mismatch");
-static_assert(logging::LOG_FATAL == MOJO_LOG_LEVEL_FATAL,
- "fatal log level value mismatch");
-
-int MojoToChromiumLogLevel(MojoLogLevel log_level) {
- // See the compile asserts above.
- return static_cast<int>(log_level);
-}
-
-MojoLogLevel ChromiumToMojoLogLevel(int chromium_log_level) {
- // See the compile asserts above.
- return static_cast<MojoLogLevel>(chromium_log_level);
-}
-
-void LogMessage(MojoLogLevel log_level,
- const char* source_file,
- uint32_t source_line,
- const char* message) {
- int chromium_log_level = MojoToChromiumLogLevel(log_level);
- int chromium_min_log_level = logging::GetMinLogLevel();
- // "Fatal" errors aren't suppressable.
- DCHECK_LE(chromium_min_log_level, logging::LOG_FATAL);
- if (chromium_log_level < chromium_min_log_level)
- return;
-
- // TODO(vtl): Possibly, we should try to pull out the file and line number
- // from |message|.
- logging::LogMessage(__FILE__, __LINE__, chromium_log_level).stream()
- << message;
-}
-
-MojoLogLevel GetMinimumLogLevel() {
- return ChromiumToMojoLogLevel(logging::GetMinLogLevel());
-}
-
-void SetMinimumLogLevel(MojoLogLevel log_level) {
- logging::SetMinLogLevel(MojoToChromiumLogLevel(log_level));
-}
-
-const MojoLogger kDefaultLogger = {
- LogMessage,
- GetMinimumLogLevel,
- SetMinimumLogLevel
-};
-
-} // namespace
-
-const MojoLogger* GetDefaultLoggerImpl() {
- return &kDefaultLogger;
-}
-
-} // namespace internal
-} // namespace mojo
« no previous file with comments | « mojo/environment/default_logger_impl.h ('k') | mojo/environment/default_run_loop_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698