Re: [Interest] Logging best practice.

2011-12-01 Thread Andre Somers
Op 1-12-2011 16:12, Stefano Cordibella schreef: Hi all, 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 fun

Re: [Interest] Logging best practice.

2011-12-01 Thread Bo Thorsen
Den 02-12-2011 08:21, Bo Thorsen skrev: > Den 01-12-2011 22:46, Charley Bay skrev: >> >> qLog(Type) << "string=" << str << ", int=" << i; >> >> That code is not re-entrant, > > Wrong. > > class LoggerHelper { > ... > ~LoggerHelper() { > doActualLogging(); > } > }; > > LoggerHelper& operator<<(Logge

Re: [Interest] Logging best practice.

2011-12-01 Thread Bo Thorsen
Den 01-12-2011 22:46, Charley Bay skrev: > > qLog(Type) << "string=" << str << ", int=" << i; > > That code is not re-entrant, Wrong. class LoggerHelper { ... ~LoggerHelper() { doActualLogging(); } }; LoggerHelper& operator<<(LoggerHelper&, const T&) { // Log T here } Bo Thorse

Re: [Interest] Logging best practice.

2011-12-01 Thread Robin Burchell
On Thu, Dec 1, 2011 at 10:46 PM, Charley Bay wrote: > That code is not re-entrant, because the "logging object" can be intercepted > by other threads entering that function. Not if such objects are local to that thread using QThreadStorage (or you do other work to make this safe), which I'm prett

Re: [Interest] Logging best practice.

2011-12-01 Thread Charley Bay
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

Re: [Interest] Logging best practice.

2011-12-01 Thread alex.blasche
> -Original Message- > From: interest-bounces+alex.blasche=nokia@qt-project.org > [mailto:interest-bounces+alex.blasche=nokia@qt-project.org] On > is the state of the art use the debug functions (qDebug, qWarning, ...) in > conjunction with a custom message handler (qInstallM

[Interest] Logging best practice.

2011-12-01 Thread Stefano Cordibella
Hi all, 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