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

Unified Diff: base/logging.h

Issue 2288473002: Implement Dump-on-DCHECK (via a new LogSeverity). (Closed)
Patch Set: Migrate some tests to EXPECT_DCHECK_DEATH Created 4 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
Index: base/logging.h
diff --git a/base/logging.h b/base/logging.h
index 2d1a83e364934af23be2eef6e990cb04294f31ff..8563170c3fde06fc8b9e0e7e514592b2fed26e2e 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -296,11 +296,14 @@ const LogSeverity LOG_INFO = 0;
const LogSeverity LOG_WARNING = 1;
const LogSeverity LOG_ERROR = 2;
const LogSeverity LOG_FATAL = 3;
-const LogSeverity LOG_NUM_SEVERITIES = 4;
+const LogSeverity LOG_DUMP = 4;
+const LogSeverity LOG_NUM_SEVERITIES = 5;
Wez 2016/12/19 23:57:46 Q: Is changing the number of severities acceptable
// LOG_DFATAL is LOG_FATAL in debug mode, ERROR in normal mode
#ifdef NDEBUG
const LogSeverity LOG_DFATAL = LOG_ERROR;
+#elif defined(DCHECK_IS_DUMP_WITHOUT_CRASH)
+const LogSeverity LOG_DFATAL = LOG_DUMP;
#else
const LogSeverity LOG_DFATAL = LOG_FATAL;
#endif
@@ -693,9 +696,9 @@ enum { DEBUG_MODE = DCHECK_IS_ON() };
#if DCHECK_IS_ON()
#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \
- COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__)
-#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL
-const LogSeverity LOG_DCHECK = LOG_FATAL;
+ COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ##__VA_ARGS__)
+#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_DFATAL
+const LogSeverity LOG_DCHECK = LOG_DFATAL;
#else // DCHECK_IS_ON()

Powered by Google App Engine
This is Rietveld 408576698