A simple logging library for C++
copy src/log.cc
and src/log.h
to your source directory.
#include "log.h"
int main()
{
logger l("log.txt");
l.log(ERROR, "error message");
return 0;
}
- TRACE
- DEBUG
- INFO
- WARNING
- ERROR
- FATAL
The full example is in the example/
directory.
You can use the set_log_level
function.
example: l.set_log_level(WARNING);
You can use the disable
function.
example: l.disable();
To enable the logger again, use the enable
function.