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

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

Issue 342653004: Mojo: Add logging macros (and supporting code) for use in mojo/public/cpp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
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
index 80a74396049f611020e0e980df390ec3b5c4b427..af4a62866b088a6a0b0cddfc20d8172af8efe4da 100644
--- a/mojo/public/cpp/environment/lib/default_logger.cc
+++ b/mojo/public/cpp/environment/lib/default_logger.cc
@@ -18,11 +18,15 @@ namespace {
MojoLogLevel g_minimum_log_level = MOJO_LOG_LEVEL_INFO;
const char* GetLogLevelString(MojoLogLevel log_level) {
- if (log_level < MOJO_LOG_LEVEL_VERBOSE)
- return "VERBOSE";
+ 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 "VERBOSE";
+ return "VERBOSE1";
case MOJO_LOG_LEVEL_INFO:
return "INFO";
case MOJO_LOG_LEVEL_WARNING:
@@ -39,7 +43,7 @@ void LogMessage(MojoLogLevel log_level, const char* message) {
return;
// TODO(vtl): Add timestamp also?
- fprintf(stderr, "%s:%s\n", GetLogLevelString(log_level), message);
+ fprintf(stderr, "%s: %s\n", GetLogLevelString(log_level), message);
if (log_level >= MOJO_LOG_LEVEL_FATAL)
abort();
}

Powered by Google App Engine
This is Rietveld 408576698