diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-03-18 16:19:17 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-12 01:25:37 +0200 |
commit | 289120f8dd25ff8b04331187dccc30b2bf88eedb (patch) | |
tree | 4f19f02468a8f120583fd137798751458af3e549 /src/corelib | |
parent | fc06df5c77e9ea08a3b2572f048e47fb7865954a (diff) |
Enable qDebug to console when desired on Android.
Change-Id: I91906c5fc2a5b406f416c296c124a01795e69b8a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qlogging.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index f95e1e9447..c8293beb4e 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -876,7 +876,13 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con #if defined(QT_USE_SLOG2) slog2_default_handler(type, logMessage.toLocal8Bit().constData()); #elif defined(Q_OS_ANDROID) - android_default_message_handler(type, context, logMessage); + static bool logToAndroid = qEnvironmentVariableIsEmpty("QT_ANDROID_PLAIN_LOG"); + if (logToAndroid) { + android_default_message_handler(type, context, logMessage); + } else { + fprintf(stderr, "%s", logMessage.toLocal8Bit().constData()); + fflush(stderr); + } #else fprintf(stderr, "%s", logMessage.toLocal8Bit().constData()); fflush(stderr); |