OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 size_t num_log_files); | 32 size_t num_log_files); |
33 ~FileRotatingLogSink() override; | 33 ~FileRotatingLogSink() override; |
34 | 34 |
35 // Writes the message to the current file. It will spill over to the next | 35 // Writes the message to the current file. It will spill over to the next |
36 // file if needed. | 36 // file if needed. |
37 void OnLogMessage(const std::string& message) override; | 37 void OnLogMessage(const std::string& message) override; |
38 | 38 |
39 // Deletes any existing files in the directory and creates a new log file. | 39 // Deletes any existing files in the directory and creates a new log file. |
40 virtual bool Init(); | 40 virtual bool Init(); |
41 | 41 |
| 42 // Disables buffering on the underlying stream. |
| 43 bool DisableBuffering(); |
| 44 |
42 protected: | 45 protected: |
43 explicit FileRotatingLogSink(FileRotatingStream* stream); | 46 explicit FileRotatingLogSink(FileRotatingStream* stream); |
44 | 47 |
45 private: | 48 private: |
46 scoped_ptr<FileRotatingStream> stream_; | 49 scoped_ptr<FileRotatingStream> stream_; |
47 | 50 |
48 DISALLOW_COPY_AND_ASSIGN(FileRotatingLogSink); | 51 DISALLOW_COPY_AND_ASSIGN(FileRotatingLogSink); |
49 }; | 52 }; |
50 | 53 |
51 // Log sink that uses a CallSessionFileRotatingStream to write to disk. | 54 // Log sink that uses a CallSessionFileRotatingStream to write to disk. |
52 // Init() must be called before adding this sink. | 55 // Init() must be called before adding this sink. |
53 class CallSessionFileRotatingLogSink : public FileRotatingLogSink { | 56 class CallSessionFileRotatingLogSink : public FileRotatingLogSink { |
54 public: | 57 public: |
55 CallSessionFileRotatingLogSink(const std::string& log_dir_path, | 58 CallSessionFileRotatingLogSink(const std::string& log_dir_path, |
56 size_t max_total_log_size); | 59 size_t max_total_log_size); |
57 ~CallSessionFileRotatingLogSink() override; | 60 ~CallSessionFileRotatingLogSink() override; |
58 | 61 |
59 private: | 62 private: |
60 scoped_ptr<CallSessionFileRotatingStream> stream_; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingLogSink); | 63 DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingLogSink); |
63 }; | 64 }; |
64 | 65 |
65 } // namespace rtc | 66 } // namespace rtc |
66 | 67 |
67 #endif // WEBRTC_BASE_FILE_ROTATING_LOG_SINK_H_ | 68 #endif // WEBRTC_BASE_FILE_ROTATING_LOG_SINK_H_ |
OLD | NEW |