summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/global/qlogging/app
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-02-03 09:35:22 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-09 18:11:21 +0100
commitbe98fa32c7d56ea91359b647a329356fa44eca04 (patch)
tree7d3941bcfe07aebb95e74e7344c774f36eaccf17 /tests/auto/corelib/global/qlogging/app
parente7e87993042ac9a4fd899da5ea0340322b47d9ff (diff)
Allow customization of qDebug output at runtime
Check the QT_OUTPUT_PATTERN environment variable in the default message handler to customize the output of messages. Following place holders are right now supported: %{message}, %{type}, %{file}, %{line}, %{function} The original cleanupFuncinfo was written by Thiago Macieira. Change-Id: I6ad25baaa0e6a1c9f886105d2a93ef3310e512a9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: David Faure <faure@kde.org>
Diffstat (limited to 'tests/auto/corelib/global/qlogging/app')
-rw-r--r--tests/auto/corelib/global/qlogging/app/app.pro9
-rw-r--r--tests/auto/corelib/global/qlogging/app/main.cpp55
2 files changed, 64 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro
new file mode 100644
index 0000000000..a167cc45cd
--- /dev/null
+++ b/tests/auto/corelib/global/qlogging/app/app.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+
+TARGET = app
+QT = core
+
+CONFIG -= debug_and_release app_bundle
+CONFIG += debug console
+
+SOURCES += main.cpp
diff --git a/tests/auto/corelib/global/qlogging/app/main.cpp b/tests/auto/corelib/global/qlogging/app/main.cpp
new file mode 100644
index 0000000000..c26b29ea56
--- /dev/null
+++ b/tests/auto/corelib/global/qlogging/app/main.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qglobal.h>
+
+struct T {
+ T() { qDebug("static constructor"); }
+ ~T() { qDebug("static destructor"); }
+} t;
+
+int main(int, char **)
+{
+ qDebug("qDebug");
+ qWarning("qWarning");
+ qCritical("qCritical");
+ return 0;
+}