Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: webrtc/base/logsinks.cc

Issue 1245143005: Remove CircularFileStream / replace it with CallSessionFileRotatingStream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add GetSize to FileRotatingStream Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/logsinks.h ('k') | webrtc/base/stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « webrtc/base/logsinks.h ('k') | webrtc/base/stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698