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

Unified Diff: base/logging.h

Issue 2638763004: Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Fix formatting & function signature. Created 3 years, 10 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 | « no previous file | base/logging.cc » ('j') | base/logging.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 7854e3934e974b4670930d6855f3ab8699a8376f..c7c96d11fd7fad1c1fd7690d13e58ccf1e4fa87a 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -15,6 +15,7 @@
#include <utility>
#include "base/base_export.h"
+#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/debug/debugger.h"
#include "base/macros.h"
@@ -277,8 +278,17 @@ BASE_EXPORT void SetShowErrorDialogs(bool enable_dialogs);
// The default handler shows a dialog box and then terminate the process,
// however clients can use this function to override with their own handling
// (e.g. a silent one for Unit Tests)
-typedef void (*LogAssertHandlerFunction)(const std::string& str);
-BASE_EXPORT void SetLogAssertHandler(LogAssertHandlerFunction handler);
+typedef base::Callback<void(const char* file,
+ int line,
+ const std::string& message,
+ const std::string& stack_trace)>
+ LogAssertHandlerFunction;
dcheng 2017/02/14 23:59:26 It seems unnecessary to use base::Callback at the
alex-ac 2017/03/09 14:15:53 base::Callback is needed because there is class me
dcheng 2017/03/09 19:41:02 That method appears to be static.
+
+// Consider to use ScopedLogAssertHandler instead of these functions.
+// see base/test/logging_utils.h.
+BASE_EXPORT void PushLogAssertHandler(LogAssertHandlerFunction handler);
+BASE_EXPORT void PopLogAssertHandler();
dcheng 2017/02/14 23:59:26 It seem like Pop and Log don't need to be exposed,
alex-ac 2017/03/09 14:15:53 Done.
+BASE_EXPORT LogAssertHandlerFunction GetLogAssertHandler();
// Sets the Log Message Handler that gets passed every log message before
// it's sent to other log destinations (if any).
« no previous file with comments | « no previous file | base/logging.cc » ('j') | base/logging.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698