c-logC/C++ 日志庫(kù)
c-log是一個(gè)穩(wěn)定,高效,多線程安全,易用,簡(jiǎn)單的C/C++ 日志庫(kù),在github主頁(yè)上有豐富的測(cè)試case,后續(xù)將會(huì)推遲直接輸出到scribe等集中式日志收集中間件上,幫助用戶更好的收集,分析日志
示例代碼:
log_init(LL_TRACE, "mysql", "./log/");
log_notice("%s [time:%d]", "test calling log", time(NULL));
log_debug("debug msg,only write to log when the loglevel bigger than or equal to debug [time:%d]", time(NULL));
log_warn("warnning msg will be writing to the error files [time:%d]", time(NULL));
log_error("you also can change number of output files by rewrite the macro_define.h");評(píng)論
圖片
表情
