Commit Graph

9 Commits

Author SHA1 Message Date
Kai Koehne
c0d249019b Allow qDebug output to be configured by qSetMessagePattern()
Add qSetMessagePattern() to configure the default
message pattern. This one can still be overwritten by setting the
QT_MESSAGE_PATTERN environment variable.

Without this method, there's actually no way to change the
default output programatically. Since QT_MESSAGE_PATTERN is
evaluated when the first message arrives, setting it via e.g. qputenv
might have no effect/be too late.

Change-Id: I115e0c30606f128fdbf5c169a951ffa2a6a48517
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-24 17:12:46 +02:00
Kai Koehne
d9a1c2dff8 Logging: Change arguments of message handler to avoid conversions
Introduce a new QtMessageHandler that takes QString instead of
char *: This avoids converting to local8bit , only to convert it back
to utf16 for Windows.

The old QMessageHandler is kept for a transition period, but will
be removed before Qt 5.0.

Also fix qEmergencyOut (that is called in OOM situations) to not rely
on the default message handler.

Change-Id: Iee0ce5838f97175c98788b847964273dd22d4a37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-20 08:37:06 +02:00
Kurt Korbatits
bc323b6fd3 Changed qlogging unittest to install subprogram
- Added install of app sub program so it works from install directory

Change-Id: Ia83643519752a3cbb59d6da2aed132d683a94bee
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:15 +01:00
Rohan McGovern
e9015b3bc8 Fixed tst_qlogging app silently not compiled in some -fast builds.
When configuring with -fast on Windows, a directory which contains two
.pro files, one SUBDIRS and one not, will have the SUBDIRS Makefile
silently clobbered by the non-SUBDIRS Makefile.  In practice, this may
cause various subdirectories to be silently excluded from the build.

Rearrange .pro files for this test to avoid triggering this bug.

Task-number: QTBUG-21168
Change-Id: Ic51941db497d7b8fb004f3c50f5ea24d90ff3114
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-02-22 04:48:36 +01:00
Friedemann Kleint
69da8588d4 Fix qlogging test.
Build app sub-process first.

Change-Id: I87a11f7fd5d8a82584e496722f79e236191b0fb3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-21 08:39:44 +01:00
Miikka Heikkinen
7c081ba942 Fix qlogging test for release configuration
The helper process 'app' wasn't built in release configuration.

Also improved finding the helper executable to utilize
QFINDTESTDATA and print out a proper errors if it could not be
found or started.

Note that adding ".exe" to process name in Windows is unnecessary
as QProcess already does that for you, so removed the ifdeffing.

Task-number: QTBUG-24330
Change-Id: Ibe75e0ecd24181ab623d0a60f17ecaf92052b0dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 05:26:58 +01:00
David Faure
b838170ceb QDebug: Add support for %{pid}, %{appname} and %{threadid}
Change-Id: I4add0a374e6524b615c6dc0ecfb010a90075b04f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 05:25:56 +01:00
Kai Koehne
dd119e14d0 Fix qlogging autotest for clang
Change-Id: Iac82c4847554534174b5419ec78319c9ac381628
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-10 15:28:22 +01:00
Kai Koehne
be98fa32c7 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>
2012-02-09 18:11:21 +01:00