diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-21 17:57:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-21 17:57:54 +0100 |
commit | 46791c08e17740418cc701b8862a980c0f711b87 (patch) | |
tree | bedba63fc48b80c2a2df54ea91c3f35398953aac /src/testlib/qplaintestlogger.cpp | |
parent | b8a38a6737acd670d92197ca5b009590d9fd8a9c (diff) | |
parent | 9033977d3971db5352a2bb51052a723a2ac57a8f (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/testlib/qplaintestlogger.cpp')
-rw-r--r-- | src/testlib/qplaintestlogger.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 480956d34a..39580f22d4 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -197,6 +197,10 @@ namespace QTest { } } +#if defined(Q_OS_WIN) +Q_CORE_EXPORT bool qWinLogToStderr(); // defined in qlogging.cpp +#endif + void QPlainTestLogger::outputMessage(const char *str) { #if defined(Q_OS_WINCE) @@ -209,7 +213,11 @@ void QPlainTestLogger::outputMessage(const char *str) } while (!strUtf16.isEmpty()); if (stream != stdout) #elif defined(Q_OS_WIN) - OutputDebugStringA(str); + // log to system log only if output is not redirected, and no console is attached + if (!qWinLogToStderr() && stream == stdout) { + OutputDebugStringA(str); + return; + } #elif defined(Q_OS_ANDROID) __android_log_write(ANDROID_LOG_INFO, "QTestLib", str); #endif |