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

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

Issue 339403003: Mojo: Make GetDefault{AsyncWaiter,Logger} static methods of Environment. (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
« no previous file with comments | « mojo/mojo_public.gypi ('k') | mojo/public/cpp/DEPS » ('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 9829ec008a50d52a5f0b8b6e9782db28a4dc9276..5e9067fb509649b4b3f6ca63dd7300c7d9da87a1 100644
--- a/mojo/public/c/environment/logger.h
+++ b/mojo/public/c/environment/logger.h
@@ -27,7 +27,8 @@ const MojoLogLevel MOJO_LOG_LEVEL_FATAL = 3;
#endif
// Structure with basic logging functions (on top of which more friendly logging
-// macros may be built). The functions are thread-safe.
+// macros may be built). The functions are thread-safe, except for
+// |SetMinimumLogLevel()| (see below).
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),
@@ -39,6 +40,15 @@ struct MojoLogger {
// logging messages below the minimum log level, this may be used to avoid
// extra work.)
MojoLogLevel (*GetMinimumLogLevel)(void);
+
+ // Sets the minimum log level (see above) to the lesser of |minimum_log_level|
+ // and |MOJO_LOG_LEVEL_FATAL|.
+ //
+ // Warning: This function may not be thread-safe, and should not be called
+ // concurrently with other |MojoLogger| functions. (In some environments --
+ // such as Chromium -- that share a logger across applications, this may mean
+ // that it is almost never safe to call this.)
+ void (*SetMinimumLogLevel)(MojoLogLevel minimum_log_level);
};
#endif // MOJO_PUBLIC_C_ENVIRONMENT_LOGGER_H_
« no previous file with comments | « mojo/mojo_public.gypi ('k') | mojo/public/cpp/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698