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

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

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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 05cafbd7ea73099bc89a296d885c83d66d719c1f..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/environment/lib/default_logger.cc
+++ /dev/null
@@ -1,69 +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 <stdio.h>
-#include <stdlib.h> // For |abort()|.
-
-#include <algorithm>
-
-#include "mojo/public/c/environment/logger.h"
-
-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* message) {
- if (log_level < g_minimum_log_level)
- return;
-
- // TODO(vtl): Add timestamp also?
- 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