On Tue, Jan 24, 2012 at 12:41 PM, <kai.koe...@nokia.com> wrote: > I've been working on a patch to the Qt logging framework: > http://codereview.qt-project.org/#change,13433,patchset=14 . Basically it > redefines qDebug() and friends as a macro so that we can automatically > capture the source file, line, and function a particular message comes from: > > qDebug("Hello world") > > actually is changed by the precompiler to: > > QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO):debug("Hello World") > > The additional information can then be processed in a custom message > handler, that also got a new signature: > > void myMessageHandler(QtMsgType type, const QMessageLogContext &context, > const char *msg) > { > switch (type) { > case QtDebugMsg: > printf("DBG: %s (%s:%i in %s)\n", msg, context.file, context.line, > context.function); } > break; > // ... > } > >
So, if I want to have also time/date on my logs, should I install a new message handler?
_______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development