|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
文件日志输出目标 更多...
#include <file_sink.hpp>
Public 成员函数 | |
| file_sink (path filename, size_t max_file_size=10 *1024 *1024, bool enable_date_rotation=true) | |
| 构造函数 | |
| void | log (const log_event &event) override |
| 写入日志事件 | |
| void | flush () override |
| 刷新文件缓冲区 | |
| Public 成员函数 继承自 log_sink | |
| void | set_formatter (unique_ptr< log_formatter > formatter) |
| 设置格式化器 | |
额外继承的成员函数 | |
| Protected 属性 继承自 log_sink | |
| unique_ptr< log_formatter > | formatter_ |
| 日志格式化器 | |
文件日志输出目标
将日志写入文件,支持以下特性:
文件名格式:
在文件 file_sink.hpp 第 36 行定义.
|
explicit |
构造函数
| filename | 基础文件名 |
| max_file_size | 文件大小上限(默认10MB) |
| enable_date_rotation | 是否启用日期轮转(默认true) |
创建文件日志输出目标,并立即打开日志文件。
| file_exception | 文件创建失败时抛出 |
|
overridevirtual |
|
overridevirtual |