[Qt-interest] Logging to files

Srdjan Todorovic todorovic.s at googlemail.com
Wed May 12 17:29:30 CEST 2010


On 12 May 2010 16:20,  <Oliver.Knoll at comit.ch> wrote:
> Srdjan Todorovic wrote on Wednesday, May 12, 2010 4:19 PM:
>
>>> ...
>>> I need to write to log files in my server application.
>>> ...
>> You do know that Qt has file I/O support, right?
>
> Logging usually involves more than just "writing debug statements to some file": it involves setting a "Log Level" ("Debug", "Warning", "Error", "Info" etc.), logging transparently into a file, a console, a database, maybe logging "over the network" etc., adding "Log Filters", automatically adding time stamps, formatting the time stamps/log messages, specifying the log output format ("Plain text", "XML", "HTML", ...), configure the logging with configuration files (or other means) etc. etc.

Not enough coffee detected in my blood-stream. ;)

Though I'd have thought at least some people do roll their own logging
framework.

It seemed to me that the OP was asking for generic file I/O support in Qt.
But I was wrong.

> So the question whether there is some Qt based solution was justified, I think. And answers have already been given (and naturally there exists also a "log4c": http://log4c.sourceforge.net/, but I do not have any experience with that).

Thanks for that pointer.

Srdjan




More information about the Qt-interest-old mailing list