diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-07-18 14:40:59 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@digia.com> | 2014-07-30 16:27:22 +0200 |
commit | e968793e81ffcb439210e7eb422c0063834cfdc9 (patch) | |
tree | e551d2d19b7f6281c117c671741d306f27267f35 /src/testlib | |
parent | c38af4e6bb51cfb1b52a38dea06a0a8a94db9545 (diff) |
Add qFormatLogMessage()
Export the former qMessageFormatString() as qFormatLogMessage(). This
allows custom message handlers to format their messages just like the
default message handler, taking qSetMessagePattern() /
QT_MESSAGE_PATTERN into account.
The method should arguably not add the '\n' at the end, which a follow
up commit will fix.
Change-Id: Ib2a9cfda91473df079daf03bf3197e6ac63e013e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestlog.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 1e7f131652..708a91b557 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtTest module of the Qt Toolkit. @@ -59,8 +59,6 @@ QT_BEGIN_NAMESPACE -Q_CORE_EXPORT QString qMessageFormatString(QtMsgType type, const QMessageLogContext &context, const QString& msg); - static void saveCoverageTool(const char * appname, bool testfailed, bool installedTestCoverage) { #ifdef __COVERAGESCANNER__ @@ -287,7 +285,7 @@ namespace QTest { // the message is expected, so just swallow it. return; - QString msg = qMessageFormatString(type, context, message); + QString msg = qFormatLogMessage(type, context, message); msg.chop(1); // remove trailing newline if (type != QtFatalMsg) { |