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

Unified Diff: mojo/public/cpp/environment/lib/default_logger.cc

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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/public/cpp/environment/lib/default_logger.h ('k') | mojo/public/cpp/environment/lib/environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/environment/lib/default_logger.cc
diff --git a/mojo/public/cpp/environment/lib/default_logger.cc b/mojo/public/cpp/environment/lib/default_logger.cc
deleted file mode 100644
index 9e72338d6a8662f145af87be51f11e5458e64d35..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/environment/lib/default_logger.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/public/cpp/environment/lib/default_logger.h"
-
-#include <mojo/environment/logger.h>
-#include <stdio.h>
-#include <stdlib.h> // For |abort()|.
-
-#include <algorithm>
-
-namespace mojo {
-
-namespace {
-
-MojoLogLevel g_minimum_log_level = MOJO_LOG_LEVEL_INFO;
-
-const char* GetLogLevelString(MojoLogLevel log_level) {
- if (log_level <= MOJO_LOG_LEVEL_VERBOSE - 3)
- return "VERBOSE4+";
- switch (log_level) {
- case MOJO_LOG_LEVEL_VERBOSE - 2:
- return "VERBOSE3";
- case MOJO_LOG_LEVEL_VERBOSE - 1:
- return "VERBOSE2";
- case MOJO_LOG_LEVEL_VERBOSE:
- return "VERBOSE1";
- case MOJO_LOG_LEVEL_INFO:
- return "INFO";
- case MOJO_LOG_LEVEL_WARNING:
- return "WARNING";
- case MOJO_LOG_LEVEL_ERROR:
- return "ERROR";
- }
- // Consider everything higher to be fatal.
- return "FATAL";
-}
-
-void LogMessage(MojoLogLevel log_level,
- const char* source_file,
- uint32_t source_line,
- const char* message) {
- if (log_level < g_minimum_log_level)
- return;
-
- // TODO(vtl): Add timestamp also?
- if (source_file) {
- fprintf(stderr, "%s: %s(%u): %s\n", GetLogLevelString(log_level),
- source_file, static_cast<unsigned>(source_line), message);
- } else {
- fprintf(stderr, "%s: %s\n", GetLogLevelString(log_level), message);
- }
- if (log_level >= MOJO_LOG_LEVEL_FATAL)
- abort();
-}
-
-MojoLogLevel GetMinimumLogLevel() {
- return g_minimum_log_level;
-}
-
-void SetMinimumLogLevel(MojoLogLevel minimum_log_level) {
- g_minimum_log_level = std::min(minimum_log_level, MOJO_LOG_LEVEL_FATAL);
-}
-
-} // namespace
-
-namespace internal {
-
-const MojoLogger kDefaultLogger = {LogMessage,
- GetMinimumLogLevel,
- SetMinimumLogLevel};
-
-} // namespace internal
-
-} // namespace mojo
« no previous file with comments | « mojo/public/cpp/environment/lib/default_logger.h ('k') | mojo/public/cpp/environment/lib/environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698