1#ifndef MSTL_LOGGING_FILE_SINK_HPP__
2#define MSTL_LOGGING_FILE_SINK_HPP__
3#include "MSTL/core/file/file.hpp"
8class MSTL_API file_sink final :
public log_sink {
11 _MSTL recursive_mutex mutex_;
14 size_t max_file_size_;
17 bool enable_date_rotation_;
21 void rotate_by_date(
string today);
22 static string default_format(log_event ev);
25 explicit file_sink(path filename,
26 size_t max_file_size = 10 * 1024 * 1024,
27 bool enable_date_rotation =
true);
29 void log(
const log_event& event)
override;
30 void flush()
override;
#define _MSTL
全局命名空间MSTL前缀
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL