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,12 +156,17 @@ DiagnosticLogMessage::DiagnosticLogMessage(const char* file,
}
DiagnosticLogMessage::~DiagnosticLogMessage() {
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);
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 (g_logging_delegate_function && severity_ <= LS_INFO) {
g_logging_delegate_function(str);
}
}
}