February 21, 2012

artem.marchenko artem.marche..
Lab Rat
54 posts

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?

3 replies

February 21, 2012

AcerExtensa AcerExtensa
Lab Rat
677 posts

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…


God is Real unless explicitly declared as Integer.

February 21, 2012

Andre Andre
Robot Herder
6663 posts

QxtLogger works just fine. There is also work going on in Qt itself to make more detailed logging possible, but that will be for Qt5.

February 21, 2012

Scylla Scylla
Lab Rat
232 posts

Or take a look at this [developer.qt.nokia.com] .

  ‹‹ Windows - Is my QT app running as Administrator?      [SOLVED]Qt Creator Intellisense or autocomplete not working? ››

You must log in to post a reply. Not a member yet? Register here!