EzLogger是一个C++的日志库,支持C++风格的stream操作符和C语言的printf函数。
示例代码:
//ExamplecodeforEZLOGGERmacros#include"ezlogger_headers.hpp"voidezlogger_simple_example(){inti=123;std::stringsomedata="HelloWorld";//SimpleusagewithstandardverbositylevelEZLOGGERSTREAM<<somedata<<""<<i<<std::endl;//CanusealternatestreamEZLOGGERSTREAM2(std::cerr)<<somedata<<"nextline"<<i<<std::endl;//VerbositylevelloggingexampleEZLOGGERVLSTREAM(axter::log_often)<<somedata<<""<<i<<std::endl;//ComplexextendeddataexampleEZLOGGERVLSTREAM(axter::levels(axter::log_often,axter::warn,__FUNCSIG__/*orGNUPRETTY_FUNCTION*/,"XyzFacility"))<<somedata<<""<<i<<std::endl;}
评论