g2logC++11 日志框架
g2log 是一個(gè)簡(jiǎn)單高效的異步日志工具,使用 C++11 實(shí)現(xiàn)。
示例代碼:
#include "g2log.h"
int main(int argc, char** argv)
{
g2logWorker g2log(argv[0], "/tmp/whatever-directory-path-you-want/");
g2::initializeLogging(&g2log);
LOG(INFO) << "Simple to use with streaming syntax, easy as ABC or " << 123;
LOGF(WARNING, "Printf-style syntax is also %s", "available");
LOGF(FATAL, "This %s is FATAL. After log flush -> Abort()", "message");
// or using the stream API
LOG(FATAL) << "This message is FATAL. After log flush -> Abort()";
}評(píng)論
圖片
表情
