Monday 15 March 2010

qt5 - Where is located the qDebug qWarning qCritical and qFatal log by default on Qt? -



qt5 - Where is located the qDebug qWarning qCritical and qFatal log by default on Qt? -

when running qt5 application on linux, don't see output qdebug, qwarning, qcritical or qfatal. know can utilize qinstallmsghandler install message handler , see them, rather heavyweight.

i want check qwarning log see if there signal mis-connected. there way @ log? special command-line option, environment variable?

i think remember in past, printed stderr, perhaps that's qt5 change?

please not create error of assuming qdebug, qwarning, qcritical , qfatal log on standard error. that's absolutely not case.

the actual destination varies depending on qt configuration , targeting os. plus, 5.4 introduced behavioural changes. see here , here discussions.

tl;dr:

on qt >= 5.4:

if want log on stderr, set qt_logging_to_console environment variable 1. if not want log on stderr, qt_logging_to_console environment variable 0 (this forcefulness logging through native scheme logger). if qt_logging_to_console environment variable is not set, whether logging console or not depends on whether application running in tty (on unix) or whether there's console window (on windows).

on qt < 5.4, situation more confusing.

if qt has been built back upwards specific logging framework (e.g. slog2, journald, android log, etc.) logging goes framework otherwise on unix goes stderr otherwise on windows outputdebugstring or stderr used depending whether app console app.

the problem pre-5.4 approach that, f.i., under unix ides not capture application's debug output if qt had been built journald support. that's because output went journald, not ide. in 5.4 approach has been made more flexible , uniform across oses.

qt qt5 qdebug

No comments:

Post a Comment