From 52130b641266248cc1e97a362ea4d875c9a1c868 Mon Sep 17 00:00:00 2001 From: "tommi@webrtc.org" Date: Sat, 7 Mar 2015 12:09:04 +0000 Subject: [PATCH] Revert 8635 "Make LS_ logging constants to match Chromium's logg..." LibjingleLoggingTests in Chromium started failing so more thought needs to be applied here. Would be good to get he perf improvement in though. > Make LS_ logging constants to match Chromium's logging constants when building with Chrome. > This was causing logging to be done at incorrect levels and filters not work as expected. > > R=perkj@webrtc.org > > Review URL: https://webrtc-codereview.appspot.com/40239004 TBR=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/43649004 Cr-Commit-Position: refs/heads/master@{#8642} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8642 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/overrides/webrtc/base/logging.cc | 21 +++++++-------------- webrtc/overrides/webrtc/base/logging.h | 10 +++++----- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/webrtc/overrides/webrtc/base/logging.cc b/webrtc/overrides/webrtc/base/logging.cc index 5f5835e265..3ef28acd8b 100644 --- a/webrtc/overrides/webrtc/base/logging.cc +++ b/webrtc/overrides/webrtc/base/logging.cc @@ -33,7 +33,7 @@ // DIAGNOSTIC_LOG. #define LOG_LAZY_STREAM_DIRECT(file_name, line_number, sev) \ LAZY_STREAM(logging::LogMessage(file_name, line_number, \ - sev).stream(), true) + -sev).stream(), true) namespace rtc { @@ -156,19 +156,12 @@ DiagnosticLogMessage::DiagnosticLogMessage(const char* file, } DiagnosticLogMessage::~DiagnosticLogMessage() { - static_assert(LS_WARNING > LS_INFO, "LS_WARNING should be greater than INFO"); - static_assert(LS_ERROR > LS_INFO, "LS_ERROR should be greater than INFO"); - - const bool call_delegate = - g_logging_delegate_function && severity_ >= LS_INFO; - - if (call_delegate || log_to_chrome_) { - print_stream_ << extra_; - const std::string& str = print_stream_.str(); - if (log_to_chrome_) - LOG_LAZY_STREAM_DIRECT(file_name_, line_, severity_) << str; - if (call_delegate) - g_logging_delegate_function(str); + print_stream_ << extra_; + const std::string& str = print_stream_.str(); + if (log_to_chrome_) + LOG_LAZY_STREAM_DIRECT(file_name_, line_, severity_) << str; + if (g_logging_delegate_function && severity_ <= LS_INFO) { + g_logging_delegate_function(str); } } diff --git a/webrtc/overrides/webrtc/base/logging.h b/webrtc/overrides/webrtc/base/logging.h index e8715c70e0..d9e0a35545 100644 --- a/webrtc/overrides/webrtc/base/logging.h +++ b/webrtc/overrides/webrtc/base/logging.h @@ -79,11 +79,11 @@ std::string ErrorName(int err, const ConstantLabel* err_table); // severity numbers than or equal to the current severity level are written to // file. Also, note that the values are explicitly defined here for convenience // since the command line flag must be set using numerical values. -enum LoggingSeverity { LS_ERROR = logging::LOG_ERROR, - LS_WARNING = logging::LOG_WARNING, - LS_INFO = logging::LOG_INFO, - LS_VERBOSE = logging::LOG_VERBOSE, - LS_SENSITIVE = LS_VERBOSE - 1, +enum LoggingSeverity { LS_ERROR = 1, + LS_WARNING = 2, + LS_INFO = 3, + LS_VERBOSE = 4, + LS_SENSITIVE = 5, INFO = LS_INFO, WARNING = LS_WARNING, LERROR = LS_ERROR };