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

Unified Diff: mojo/public/c/environment/logger.h

Issue 334263010: Mojo: Add GetMinimumLogLevel() to the logger interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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
« no previous file with comments | « mojo/environment/default_logger_impl.cc ('k') | mojo/public/cpp/environment/environment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/environment/logger.h
diff --git a/mojo/public/c/environment/logger.h b/mojo/public/c/environment/logger.h
index fd9a88fc6f4bbad7a830dcc41ee16ef5870c861d..fe2ed191edc8624260bda1bc2eb5b893ec3138e8 100644
--- a/mojo/public/c/environment/logger.h
+++ b/mojo/public/c/environment/logger.h
@@ -25,8 +25,19 @@ const MojoLogLevel MOJO_LOG_LEVEL_FATAL = 3;
#define MOJO_LOG_LEVEL_FATAL ((MojoLogLevel) 3)
#endif
+// Structure with basic logging functions (on top of which more friendly logging
+// macros may be built). The functions are thread-safe.
struct MojoLogger {
+ // Logs |message| at level |log_level| if |log_level| is at least the current
+ // minimum log level. If |log_level| is |MOJO_LOG_LEVEL_FATAL| (or greater),
+ // aborts the application/process.
void (*LogMessage)(MojoLogLevel log_level, const char* message);
+
+ // Gets the minimum log level (see above), which will always be at most
+ // |MOJO_LOG_LEVEL_FATAL|. (Though |LogMessage()| will automatically avoid
+ // logging messages below the minimum log level, this may be used to avoid
+ // extra work.)
+ MojoLogLevel (*GetMinimumLogLevel)(void);
};
#endif // MOJO_PUBLIC_C_ENVIRONMENT_LOGGER_H_
« no previous file with comments | « mojo/environment/default_logger_impl.cc ('k') | mojo/public/cpp/environment/environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698