Index: webrtc/base/logsinks.cc |
diff --git a/webrtc/base/logsinks.cc b/webrtc/base/logsinks.cc |
index e202a81f1e8a636df6bea2d7da5da56785fd4261..496833915662f168b3c3b390a1fb255e3c2b2442 100644 |
--- a/webrtc/base/logsinks.cc |
+++ b/webrtc/base/logsinks.cc |
@@ -10,8 +10,11 @@ |
#include "webrtc/base/logsinks.h" |
+#include <iostream> |
#include <string> |
+#include "webrtc/base/checks.h" |
+ |
namespace rtc { |
FileRotatingLogSink::FileRotatingLogSink(const std::string& log_dir_path, |
@@ -26,14 +29,15 @@ FileRotatingLogSink::FileRotatingLogSink(const std::string& log_dir_path, |
FileRotatingLogSink::FileRotatingLogSink(FileRotatingStream* stream) |
: stream_(stream) { |
+ DCHECK(stream); |
} |
FileRotatingLogSink::~FileRotatingLogSink() { |
} |
void FileRotatingLogSink::OnLogMessage(const std::string& message) { |
- if (!stream_ || stream_->GetState() != SS_OPEN) { |
- LOG(LS_WARNING) << "Init() must be called before adding this sink."; |
+ if (stream_->GetState() != SS_OPEN) { |
+ std::cerr << "Init() must be called before adding this sink." << std::endl; |
return; |
} |
stream_->WriteAll(message.c_str(), message.size(), nullptr, nullptr); |
@@ -43,6 +47,10 @@ bool FileRotatingLogSink::Init() { |
return stream_->Open(); |
} |
+bool FileRotatingLogSink::DisableBuffering() { |
+ return stream_->DisableBuffering(); |
+} |
+ |
CallSessionFileRotatingLogSink::CallSessionFileRotatingLogSink( |
const std::string& log_dir_path, |
size_t max_total_log_size) |