代码拉取完成,页面将自动刷新
This is a simple logging library for C/C++.
This library's main features:
./build.sh
cd build
make
sudo make install
or
build.bat
or
Copy files in src directory to your project
Note: Operations are confirmed on the above platforms
This following table comparing other libraries is benchmark results to log 1,000,000 times.
threads | c-logger | glog |
---|---|---|
1 | 0.832s | 1.267s |
10 | 1.386s | 1.183s |
Benchmark environment
level yy-MM-dd hh:mm:ss:uuuuuu threadid file:line: message
logger_initConsoleLogger(stderr);
logger_setLevel(LogLevel_DEBUG);
LOG_INFO("console logging");
logger_initFileLogger("logs/log.txt", 1024 * 1024, 5);
logger_setLevel(LogLevel_DEBUG);
LOG_INFO("file logging");
LOG_DEBUG("format example: %d%c%s", 1, '2', "3");
The output of the file logger is the following:
I 15-11-10 00:32:43.771455 2854 filelogger.c:6: file logging
D 15-11-10 00:32:43.771564 2854 filelogger.c:7: format example: 123
logger_initConsoleLogger(NULL);
logger_initFileLogger("logs/log.txt", 0, 0);
LOG_INFO("multi logging");
The MIT license
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。