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 | 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,...) |
void | SetLevel (LogLevel level) |
LogLevel | GetLevel (void) |
void | ShowShortFileName (bool shortName) |
int | IsEnabled (LogLevel level) |
void | LoggerFlush () |
void | EnableOutputHtmlFormat (bool isHtml) |
开启Html格式,输出日志。 | |
FILE * | FileHandler () const |
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_maxFileSize |
unsigned char | m_maxBackupFiles |
long | m_currentFileSize |
unsigned long long | m_flushedTime |
unsigned long long | m_flushInterval |
LogLevel | m_logLevel |
bool | m_isShowShortFileName |
bool | m_isHtmlStyle |
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 | ) |
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, | ||
... | |||
) |
void BUI::LoggerStorage::PrintLogW | ( | LogLevel | level, |
BOOL | print_timestamp, | ||
const char * | file, | ||
int | line, | ||
const WCHAR * | fmt, | ||
... | |||
) |
|
protected |
void BUI::LoggerStorage::SaveConfigureToFile | ( | ) |
void BUI::LoggerStorage::SetLevel | ( | LogLevel | level | ) |
void BUI::LoggerStorage::ShowShortFileName | ( | bool | shortName | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |