Stefano spaketh: > > is the state of the art use the debug functions (qDebug, qWarning, > ...) in > > conjunction with a custom message handler (qInstallMsgHandler) for log to > > file system? > > I found very simple and useful this approach, but I think that a log > function > > with message level is needed (i.e: qMessage() ) for a complete set of > logging > > levels. > > Anyone else think that we need a new function with message log level? >
Alex respondeth: > I do. We are actually working on something based on qLog ( > http://docs.huihoo.com/qt/qtextended/4.4/debug-qtextended.html#qlog-categorized-logging > ) > > Initially we only started to look at it because we needed something in > QtSensors but I definitely see this as a more generic thing. Besides > porting it to Qt5 we are still investigating its usefulness as a generic > Qt5 thing. We should soon have some preliminary results. > > So I guess, watch this space... I agree that a good/strong logging infrastructure would be a good generic thing. However, beware of the convention in that link that does this: qLog(Type) << "string=" << str << ", int=" << i; That code is not re-entrant, because the "logging object" can be intercepted by other threads entering that function. We started out with that syntax, and then had to change *all* our invocations for our multi-threaded applications to make our functions re-entrant, like: qlog(Type).logSomeMessage("some assembled message"); Just an FYI, our code *must* permit re-entrant code for logging. --charley
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest