Re-landing perf improvement for libjingle logging after reverting the general change.

This contains only a part of r8635 that I just reverted to unblock the roll.

TBR=perkj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42259004

Cr-Commit-Position: refs/heads/master@{#8643}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8643 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tommi@webrtc.org 2015-03-07 12:18:03 +00:00
parent 52130b6412
commit f696e49c9a

View File

@ -156,6 +156,10 @@ DiagnosticLogMessage::DiagnosticLogMessage(const char* file,
} }
DiagnosticLogMessage::~DiagnosticLogMessage() { DiagnosticLogMessage::~DiagnosticLogMessage() {
const bool call_delegate =
g_logging_delegate_function && severity_ <= LS_INFO;
if (call_delegate || log_to_chrome_) {
print_stream_ << extra_; print_stream_ << extra_;
const std::string& str = print_stream_.str(); const std::string& str = print_stream_.str();
if (log_to_chrome_) if (log_to_chrome_)
@ -163,6 +167,7 @@ DiagnosticLogMessage::~DiagnosticLogMessage() {
if (g_logging_delegate_function && severity_ <= LS_INFO) { if (g_logging_delegate_function && severity_ <= LS_INFO) {
g_logging_delegate_function(str); g_logging_delegate_function(str);
} }
}
} }
// static // static