Add ICU message format support
[chromium-blink-merge.git] / content / renderer / media / webrtc_logging.cc
blob17e5c5745420d96fcd68aefd64911bdf1f9c5140
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/renderer/media/webrtc_logging.h"
7 #include "base/time/time.h"
8 #include "content/public/renderer/webrtc_log_message_delegate.h"
9 #include "third_party/webrtc/overrides/webrtc/base/logging.h"
11 namespace content {
13 // Shall only be set once and never go back to NULL.
14 WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL;
16 void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) {
17 CHECK(!g_webrtc_logging_delegate);
18 CHECK(delegate);
20 g_webrtc_logging_delegate = delegate;
23 void InitWebRtcLogging() {
24 // Log messages from Libjingle should not have timestamps.
25 rtc::InitDiagnosticLoggingDelegateFunction(&WebRtcLogMessage);
28 void WebRtcLogMessage(const std::string& message) {
29 if (g_webrtc_logging_delegate)
30 g_webrtc_logging_delegate->LogMessage(message);
33 } // namespace content