From 64e5cc08486a26556c03c92fe3f746c8a6eaacb6 Mon Sep 17 00:00:00 2001 From: "hansl@google.com" Date: Wed, 3 Nov 2010 19:20:27 +0000 Subject: Fix the testing::LogDisabler for the change r64883. See http://codereview.chromium.org/4262001/show The r64883 broke most unit tests in CEEE that relied on disabling logs while testing error paths. BUG=None TEST=None Review URL: http://codereview.chromium.org/4390001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64948 0039d316-1c4b-4281-b951-d872f2087c98 --- base/logging.cc | 4 ++++ base/logging.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'base') diff --git a/base/logging.cc b/base/logging.cc index ee4a4da..1ca00fb 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -420,6 +420,10 @@ void SetLogMessageHandler(LogMessageHandlerFunction handler) { log_message_handler = handler; } +LogMessageHandlerFunction GetLogMessageHandler() { + return log_message_handler; +} + // MSVC doesn't like complex extern templates and DLLs. #if !defined(COMPILER_MSVC) // Explicit instantiations for commonly used comparisons. diff --git a/base/logging.h b/base/logging.h index e1b088c..7315ea5 100644 --- a/base/logging.h +++ b/base/logging.h @@ -245,6 +245,7 @@ void SetShowErrorDialogs(bool enable_dialogs); // (e.g. a silent one for Unit Tests) typedef void (*LogAssertHandlerFunction)(const std::string& str); void SetLogAssertHandler(LogAssertHandlerFunction handler); + // Sets the Log Report Handler that will be used to notify of check failures // in non-debug mode. The default handler shows a dialog box and continues // the execution, however clients can use this function to override with their @@ -258,6 +259,7 @@ void SetLogReportHandler(LogReportHandlerFunction handler); // should not be sent to other log destinations. typedef bool (*LogMessageHandlerFunction)(int severity, const std::string& str); void SetLogMessageHandler(LogMessageHandlerFunction handler); +LogMessageHandlerFunction GetLogMessageHandler(); typedef int LogSeverity; const LogSeverity LOG_INFO = 0; -- cgit v1.1