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

Unified Diff: base/logging.h

Issue 460094: Make POSIX SIGTERM/SIGINT/SIGHUP handler async signal safe. (Closed)
Patch Set: move shutdown thread creation after UI thread is registered. Created 11 years 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 | « no previous file | base/logging.cc » ('j') | chrome/browser/browser_main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/logging.h
diff --git a/base/logging.h b/base/logging.h
index 4fbe4830f28b7fb9ce4ccb79b8ebce6c5809a7f0..cac9ca34cb1c40ef7d9cf0265007fc362d9a7a5e 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -772,6 +772,17 @@ class ErrnoLogMessage {
// after this call.
void CloseLogFile();
+// Async signal safe logging mechanism.
+void RawLog(int level, const char* message);
+
+#define RAW_LOG(level, message) logging::RawLog(logging::LOG_ ## level, message)
+
+#define RAW_CHECK(condition) \
+ do { \
+ if (!(condition)) \
+ logging::RawLog(logging::LOG_FATAL, "Check failed: " #condition "\n"); \
+ } while (0)
+
} // namespace logging
// These functions are provided as a convenience for logging, which is where we
« no previous file with comments | « no previous file | base/logging.cc » ('j') | chrome/browser/browser_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698