|
CBlueUI
C++ 跨平台跨框架的数据可视化工具
|
日志存储 更多...
Public 成员函数 | |
| LoggerStorage () | |
| ~LoggerStorage () | |
| int | LoadConfigureFromFile (const char *filename) |
| void | SaveConfigureToFile () |
| int | InitConsoleLogger (FILE *output) |
| Initialize the logger as a console logger. | |
| int | InitFileLogger (const char *filename, long maxFileSize=1024 *1024 *10, unsigned char maxBackupFiles=100) |
| void | UseTimestampUTC (bool is_utc) |
| 时间模式为UTC标准时间 | |
| void | PrintLogA (LogLevel level, BOOL print_timestamp, const char *file, int line, const char *fmt,...) |
| 打印(多字节字符版本) | |
| void | PrintLogW (LogLevel level, BOOL print_timestamp, const char *file, int line, const WCHAR *fmt,...) |
| 打印(宽字符版本) | |
| FILE * | FileHandler () const |
| 获得文件句柄 | |
| void | LoggerFlush () |
| 将系统缓存数据立即写入存储设备 | |
| int | IsEnabled (LogLevel level) |
| 判断level等级 >= 过滤等级 | |
| void | SetLevel (LogLevel level) |
| 设置过滤等级 | |
| LogLevel | GetLevel (void) |
| 获得过滤等级 | |
| void | ShowShortFileName (bool shortName) |
| 文件路径短名称打印输出使能 | |
| void | EnableOutputHtmlFormat (bool isHtml) |
| 开启Html格式,输出日志。 | |
Protected 成员函数 | |
| int | rotateLogFiles () |
| void | getBackupFileName (const char *basename, unsigned char index, char *backupname, size_t size) |
| long | vflog (FILE *fp, LogLevel levelc, const char *timestamp, long threadID, const char *file, int line, const char *fmt, va_list arg, unsigned long long currentTime, unsigned long long *flushedTime) |
| void | parseLine (char *line) |
Protected 属性 | |
| BeStringA | m_configfilename |
| UINT | m_output_flags |
| FILE * | m_output_console |
| FILE * | m_output_file |
| BeStringA | m_filename |
| BeStringA | m_fileExt |
| long | m_max_file_size |
| unsigned char | m_max_backup_files |
| long | m_current_file_size |
| unsigned long long | m_flushed_time |
| unsigned long long | m_flush_interval |
| LogLevel | m_log_level |
| bool | m_is_show_short_file_name |
| bool | m_is_html_style |
| bool | m_is_utc_time |
| AtomicLock | m_mutex |
日志存储
| BUI::LoggerStorage::LoggerStorage | ( | ) |
| BUI::LoggerStorage::~LoggerStorage | ( | ) |
| void BUI::LoggerStorage::EnableOutputHtmlFormat | ( | bool | isHtml | ) |
开启Html格式,输出日志。
| isHtml | true:使用html格式;false:普通文本格式 |
| FILE * BUI::LoggerStorage::FileHandler | ( | ) | const |
获得文件句柄
|
protected |
| LogLevel BUI::LoggerStorage::GetLevel | ( | void | ) |
获得过滤等级
| int BUI::LoggerStorage::InitConsoleLogger | ( | FILE * | output | ) |
Initialize the logger as a console logger.
| output | If the file pointer is NULL, stdout will be used. |
| int BUI::LoggerStorage::InitFileLogger | ( | const char * | filename, |
| long | maxFileSize = 1024 *1024 *10, |
||
| unsigned char | maxBackupFiles = 100 |
||
| ) |
| filename | The name of the output file |
| maxFileSize | The maximum number of bytes to write to any one file |
| maxBackupFiles | The maximum number of files for backup |
| int BUI::LoggerStorage::IsEnabled | ( | LogLevel | level | ) |
判断level等级 >= 过滤等级
| int BUI::LoggerStorage::LoadConfigureFromFile | ( | const char * | filename | ) |
Configure the logger with a configuration file. If the filename is NULL, return without doing anything.
The following is the configurable key/value list.
| key | value |
|---|---|
| level | TRACE, DEBUG, INFO, WARN, ERROR or FATAL |
| autoFlush | A flush interval [ms] (off if interval <= 0) |
| logger | console or file |
| logger.console.output | stdout or stderr |
| logger.file.filename | A output filename (max length is 255 bytes) |
| logger.file.maxFileSize | 1-LONG_MAX [bytes] (1 MB if size <= 0) |
| logger.file.maxBackupFiles | 0-65535 |
| logger.format | html, txt |
| [in] | filename | The name of the configuration file |
| void BUI::LoggerStorage::LoggerFlush | ( | ) |
将系统缓存数据立即写入存储设备
|
protected |
| void BUI::LoggerStorage::PrintLogA | ( | LogLevel | level, |
| BOOL | print_timestamp, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
打印(多字节字符版本)
| level | : 日志等级 |
| print_timestamp | : 是否打印时间戳 |
| file | : 文件路径 |
| line | : 行号 |
| fmt | : 格式文本 |
| ... | : 变长参数 |
| void BUI::LoggerStorage::PrintLogW | ( | LogLevel | level, |
| BOOL | print_timestamp, | ||
| const char * | file, | ||
| int | line, | ||
| const WCHAR * | fmt, | ||
| ... | |||
| ) |
打印(宽字符版本)
| level | : 日志等级 |
| print_timestamp | : 是否打印时间戳 |
| file | : 文件路径 |
| line | : 行号 |
| fmt | : 格式文本 |
| ... | : 变长参数 |
|
protected |
| void BUI::LoggerStorage::SaveConfigureToFile | ( | ) |
| void BUI::LoggerStorage::SetLevel | ( | LogLevel | level | ) |
设置过滤等级
| void BUI::LoggerStorage::ShowShortFileName | ( | bool | shortName | ) |
文件路径短名称打印输出使能
| void BUI::LoggerStorage::UseTimestampUTC | ( | bool | is_utc | ) |
时间模式为UTC标准时间
| is_utc | The name of the output file |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |