- 简洁但是功能实用
- 线程安全
- 支持动态加载配置文件,修改日志等级 (kill -USR1 )
- Auto shift file log by daily
- Auto delete old log file if you need
- 10万/s 日志写入
- 如果没有找到,会将日志以debug级别输出到控制台
log_level=INFO
log_dir=log
log_file=simple.log
retain_day=7
#include "simple_log.h"
int main() {
int ret = log_init("conf", "simple_log.conf");
if (ret != 0) {
printf("log_init error!\n");
return 1;
}
LOG_INFO("%s", "this is a info log");
return 0;
}
make && make test && ./output/bin/simple_log_test
2014-10-25 15:43:29.216 INFO test/simple_log_test.cpp(5): this is a info log