> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On > Behalf Of Koehne Kai (Nokia-MP/Berlin) > Sent: Tuesday, January 24, 2012 1:39 PM > To: [email protected] > Cc: [email protected] > Subject: Re: [Development] Work on qDebug and friends > > > -----Original Message----- > > From: ext Diego Iastrubni [mailto:[email protected]] > > Sent: Tuesday, January 24, 2012 1:18 PM > > To: Koehne Kai (Nokia-MP/Berlin) > > Cc: [email protected] > > Subject: Re: [Development] Work on qDebug and friends > > > > So, if I want to have also time/date on my logs, should I install a > > new message handler? > > Well, I plan to work on a simple environment switch which will enable the > default logger to show the file, line, and the log level. My idea is that an > IDE > e.g. Qt Creator sets this environment variable, and voila, you can suddenly > click on your log messages :)
Finally I came around to actually implement something: http://codereview.qt-project.org/#change,15129 The idea is that you can customize the output by setting the QT_DEBUG_PATTERN environment variable. Setting it e.g. to "[%type%] %file%:%line% %function% %message%" Would generate lines like: [debug] ../helloworld/main.cpp:7 main HELLO WORLD However, I'm not really sure whether that belongs into Qt Core or not. I'm happy to move the code elsewhere if we're going for a separate plugin/module. That's why it's also not a completely polished patch (documentation is missing + there is an ugly busy wait for concurrent access in qMessageHandlerTokens. Any hints for more elegant solutions are welcome). Regards Kai Koehne PS: The code simplifying Q_FUNC_INFO output (qCleanupFuncinfo) stems from Thiago . The autotest that he also wrote is producing some failures though :( _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
