C++ 的日志库:EzLogger

jopen 11年前

EzLogger 是一个 C++ 的日志库,支持 C++ 风格的 stream 操作符和 C 语言的 printf 函数。

示例代码:

// Example code for EZLOGGER macros  #include "ezlogger_headers.hpp"    void ezlogger_simple_example()  {          int i = 123;          std::string somedata = "Hello World";            //Simple usage with standard verbosity level          EZLOGGERSTREAM << somedata << " " << i << std::endl;            //Can use alternate stream          EZLOGGERSTREAM2(std::cerr) << somedata << " next line " << i << std::endl;            //Verbosity level logging example          EZLOGGERVLSTREAM(axter::log_often) << somedata << " " << i << std::endl;            //Complex extended data example          EZLOGGERVLSTREAM(axter::levels(axter::log_often, axter::warn, __FUNCSIG__ /*or GNU PRETTY_FUNCTION*/, "Xyz Facility")) << somedata << " " << i << std::endl;  }

项目主页:http://www.open-open.com/lib/view/home/1377142694397