Logging library for Qt
-
I am quite new to Qt and I am looking for a logging library.
Something that would have several priorities to be enabled, disabled (errors, warnings, infos), could print to console or file and ideally have a set of macros that would automagically add classname and method name to the log file.
I tried googling around, managed to find mentions of Log4Qt and QxtLogger, but somehow not much activity around them and surprising amount of messages on just using qInstallMsgHandler() and creating a custom logger just for yourself.
What would be a supported logging library to study closer?
Or is everybody really creating his own logger and that's it? -
Why do you need any logging libraries? Qt has great and simple logging possibilities...
Using qDebug(), qWarning() & qCritical() with implemented MsgHandler function can do everything what you need and it's done in 5 minutes...
-
Or take a look at "this":http://developer.qt.nokia.com/forums/viewthread/2654 .
-
Hi. Writing qInstallMsgHandler() yourself is pointless. There's a ready-made library that already implements all the necessary cases: https://github.com/yamixst/qtlogger
Just include qtlogger.h, call gQtLogger.configure(), and you've got super-advanced logging :) -
Hi. Writing qInstallMsgHandler() yourself is pointless. There's a ready-made library that already implements all the necessary cases: https://github.com/yamixst/qtlogger
Just include qtlogger.h, call gQtLogger.configure(), and you've got super-advanced logging :)@xstream Hi,
Thanks for sharing ! It looks pretty interesting.
I think there might be one thing missing from it: QLoggingCategory support. -
@xstream Hi,
Thanks for sharing ! It looks pretty interesting.
I think there might be one thing missing from it: QLoggingCategory support. -
My bad ! I somehow missed your use of QLoggingCategory although I looked for it.