[Development] [Request] Add Info to QDebug

Thiago Macieira thiago.macieira at intel.com
Mon Dec 23 14:42:44 CET 2013


On segunda-feira, 23 de dezembro de 2013 14:06:07, Kurt Pattyn wrote:
> > - Warning: is a notice that something went wrong, but it might not affect
> > the application. You can disable it with QT_NO_WARNING_OUTPUT since is
> > not that important.
> 
> Warnings are not errors, and do not require immediate action; example: file
> system is 80% full. They normally indicate that something might go wrong in
> the future if no action is taken.

True, but that's now how we use them in Qt. We use them as "programmer error, 
parameters are invalid" or "unknown condition happened", but stuff that we 
managed to continue from.

> Errors are conditions in an application that do not need urgent attention,
> but should be resolved as soon as possible. The application keeps working,
> possibly with reduced functionality or performance.

This is what we use warnings for.

> > - Critical: something serious really happened, so the message can't be
> > disabled. You really want to print something because something critical is
> > happening.
> 
> Critical conditions make the application loose essential functionality. The
> application cannot be used anymore for its intended purpose.
> > - Fatal: same as above, but the application even aborts afterwards.
> 
> Fatal conditions affect not only the application, but also the surrounding
> system. The application and possibly the whole system should be shutdown
> immediately. A good example is loss of control of an X-ray beam in an X-ray
> scanner. Even in this situation, just kicking out the application is very
> often not a good option. It often should start an emergency procedure.

I don't see the difference between fatal and critical when looking at a single 
application. If the application can't continue, it's fatal for the 
application: it's dead. We use qFatal to log situations that terminate the 
application.

> The proposal is not to mimic the syslog events, but at least to have a more
> fine-grained control over the log messages. Most logging systems have the
> info and error severity levels. Here is a small overview together with a
> potential mapping to qDebug, qInfo, …:

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131223/d3444dbd/attachment.sig>


More information about the Development mailing list