cclog 是简单的 C++ 日志系统,segmentation fault 等异常情况可以打印出函数调用栈信息。
API:
// @argv0 argv[0] or any valid string for a file name. void init_cclog(const std::string& argv0); // write all buffered logs to destination and stop the logging thread. void StopLogging();
简单示例:
LOG << "hello" << ' ' << "world"; LOG_IF(1 + 1 == 2) << "1 + 1 = 2"; ELOG << L"hello again"; CHECK_EQ(1, 2) << "1 != 2";