12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #ifndef RTC_BASE_LOG_SINKS_H_
- #define RTC_BASE_LOG_SINKS_H_
- #include <stddef.h>
- #include <memory>
- #include <string>
- #include "rtc_base/constructor_magic.h"
- #include "rtc_base/file_rotating_stream.h"
- #include "rtc_base/logging.h"
- namespace rtc {
- class FileRotatingLogSink : public LogSink {
- public:
-
-
- FileRotatingLogSink(const std::string& log_dir_path,
- const std::string& log_prefix,
- size_t max_log_size,
- size_t num_log_files);
- ~FileRotatingLogSink() override;
-
-
- void OnLogMessage(const std::string& message) override;
- void OnLogMessage(const std::string& message,
- LoggingSeverity sev,
- const char* tag) override;
-
- virtual bool Init();
-
- bool DisableBuffering();
- protected:
- explicit FileRotatingLogSink(FileRotatingStream* stream);
- private:
- std::unique_ptr<FileRotatingStream> stream_;
- RTC_DISALLOW_COPY_AND_ASSIGN(FileRotatingLogSink);
- };
- class CallSessionFileRotatingLogSink : public FileRotatingLogSink {
- public:
- CallSessionFileRotatingLogSink(const std::string& log_dir_path,
- size_t max_total_log_size);
- ~CallSessionFileRotatingLogSink() override;
- private:
- RTC_DISALLOW_COPY_AND_ASSIGN(CallSessionFileRotatingLogSink);
- };
- }
- #endif
|