QtDebug: Include file, line, function information
authorKai Koehne <kai.koehne@nokia.com>
Tue, 17 Jan 2012 15:20:45 +0000 (16:20 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 1 Feb 2012 01:16:32 +0000 (02:16 +0100)
commitd394ca7f27197cfbfc28eb9a08eb0db261dd9d3d
treee75e133531101682473f91f5feca6c88c3e38c6c
parentea783ff51f25af89b7219154d7be5de1fd138664
QtDebug: Include file, line, function information

Record the file, line, and function where a qDebug, qWarning, qCritical
or qFatal call happens, and make this information available in a custom
message handler.

The patch uses the C preprocessor to replace qDebug, qWarning, ... with
a line that also records the current file, line, and function. Custom
message handlers can access this information via a new QMessageLogContext
argument.

Change-Id: I0a9b89c1d137e41775932d3b1a35da4ebf12d18d
Reviewed-by: David Faure <faure@kde.org>
14 files changed:
doc/src/snippets/code/src_corelib_global_qglobal.cpp
doc/src/snippets/qlogging/qloggingsnippet.cpp [new file with mode: 0644]
src/corelib/global/global.pri
src/corelib/global/qglobal.cpp
src/corelib/global/qglobal.h
src/corelib/global/qlogging.cpp [new file with mode: 0644]
src/corelib/global/qlogging.h [new file with mode: 0644]
src/corelib/io/qdebug.h
src/corelib/kernel/qcoreapplication_win.cpp
src/tools/bootstrap/bootstrap.pro
tests/auto/corelib/global/global.pro
tests/auto/corelib/global/qmessagehandler/qmessagehandler.pro [new file with mode: 0644]
tests/auto/corelib/global/qmessagehandler/tst_qmessagehandler.cpp [new file with mode: 0644]
tests/auto/corelib/io/qdebug/tst_qdebug.cpp