Index: base/logging.h |
diff --git a/base/logging.h b/base/logging.h |
index 714545c02bb06ac7f1b31e8a007b671e6dc11d6d..95fe2464e141c9fdc85be736c14675186ffbdc24 100644 |
--- a/base/logging.h |
+++ b/base/logging.h |
@@ -279,14 +279,23 @@ BASE_EXPORT void SetShowErrorDialogs(bool enable_dialogs); |
typedef void (*LogAssertHandlerFunction)(const std::string& str); |
BASE_EXPORT void SetLogAssertHandler(LogAssertHandlerFunction handler); |
-// Sets the Log Message Handler that gets passed every log message before |
-// it's sent to other log destinations (if any). |
-// Returns true to signal that it handled the message and the message |
-// should not be sent to other log destinations. |
-typedef bool (*LogMessageHandlerFunction)(int severity, |
- const char* file, int line, size_t message_start, const std::string& str); |
-BASE_EXPORT void SetLogMessageHandler(LogMessageHandlerFunction handler); |
-BASE_EXPORT LogMessageHandlerFunction GetLogMessageHandler(); |
+// LogMessageListener is the callback interface for log message listening. |
+// OnMessage() is called for every log message before it's sent to other log |
+// destinations (if any). |
+class BASE_EXPORT LogMessageListener { |
+ public: |
+ virtual ~LogMessageListener(); |
+ virtual void OnMessage(int severity, |
+ const char* file, |
+ int line, |
+ size_t message_start, |
+ const std::string& str) = 0; |
+ |
+ protected: |
+ LogMessageListener(); |
+}; |
+ |
+BASE_EXPORT size_t LogMessageListenerCountForTesting(); |
typedef int LogSeverity; |
const LogSeverity LOG_VERBOSE = -1; // This is level 1 verbosity |