Index: content/renderer/media/webrtc_logging.cc |
diff --git a/content/renderer/media/webrtc_logging.cc b/content/renderer/media/webrtc_logging.cc |
index 29cf5f50c9b1e6c1249e5662702c4f0c9c73d093..96868a6836cae1c1321a5c2363b170dd2d20a25d 100644 |
--- a/content/renderer/media/webrtc_logging.cc |
+++ b/content/renderer/media/webrtc_logging.cc |
@@ -4,9 +4,6 @@ |
#include "content/renderer/media/webrtc_logging.h" |
-#include <iomanip> |
-#include <sstream> |
- |
#include "base/time/time.h" |
#include "content/public/renderer/webrtc_log_message_delegate.h" |
#include "third_party/libjingle/overrides/talk/base/logging.h" |
@@ -15,44 +12,22 @@ namespace content { |
// Shall only be set once and never go back to NULL. |
WebRtcLogMessageDelegate* g_webrtc_logging_delegate = NULL; |
-uint64 g_started_time_ms_ = 0; |
void InitWebRtcLoggingDelegate(WebRtcLogMessageDelegate* delegate) { |
CHECK(!g_webrtc_logging_delegate); |
CHECK(delegate); |
g_webrtc_logging_delegate = delegate; |
- |
- g_started_time_ms_ = base::Time::Now().ToInternalValue() / |
- base::Time::kMicrosecondsPerMillisecond; |
-} |
- |
-void WebRtcLogMessageWithTimestamp(const std::string& message) { |
- if (g_webrtc_logging_delegate) |
- g_webrtc_logging_delegate->LogMessage(message); |
} |
void InitWebRtcLogging() { |
- // Log messages from Libjingle should always have timestamps. |
- talk_base::InitDiagnosticLoggingDelegateFunction( |
- WebRtcLogMessageWithTimestamp); |
+ // Log messages from Libjingle should not have timestamps. |
+ talk_base::InitDiagnosticLoggingDelegateFunction(&WebRtcLogMessage); |
} |
void WebRtcLogMessage(const std::string& message) { |
- // Keep consistent with talk_base::DiagnosticLogMessage::CreateTimestamp. |
- // TODO(grunell): remove the duplicated code and unify the timestamp creation. |
- uint64 now_us = base::Time::Now().ToInternalValue(); |
- uint64 interval_ms = now_us / base::Time::kMicrosecondsPerMillisecond - |
- g_started_time_ms_; |
- |
- std::ostringstream message_oss; |
- message_oss << "[" << std::setfill('0') << std::setw(3) |
- << (interval_ms / 1000) |
- << ":" << std::setw(3) |
- << (interval_ms % 1000) |
- << std::setfill(' ') << "] " << message; |
- |
- WebRtcLogMessageWithTimestamp(message_oss.str()); |
+ if (g_webrtc_logging_delegate) |
+ g_webrtc_logging_delegate->LogMessage(message); |
} |
} // namespace content |