dept2 / CuteLogger

Logger: simple, convinient and thread safe logger for Qt-based C++ apps
GNU Lesser General Public License v2.1
147 stars 96 forks source link

how to set Level for log? #11

Closed dragondjf closed 9 years ago

dragondjf commented 9 years ago

i want message which level>Info, if level < Info, it shoudn't log to consle/file, how to do this?

cyberbobs commented 9 years ago

You should use AbstractAppender::setDetailsLevel method to set the minimal log level to be written to the appender. Example for the FileAppender (writing to file):

FileAppender* fileAppender = new FileAppender("app.log");
fileAppender->setDetailsLevel(Logger::Info);
logger->registerAppender(fileAppender);

Try building the Doxygen documentation for the library, this property is well described there.