C++11 日志框架:g2log
g2log 是一个简单高效的异步日志工具,使用 C++11 实现。
示例代码:
#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()"; }
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!