From e8af66f90684946eb56ffcce9fa0c7909ba0c390 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 24 Sep 2013 00:20:56 +0200 Subject: [PATCH] Add newlines to qEmergencyOut output on stderr. qt_message, in the regular case, calls qt_message_print, which invokes the default message handler (qDefaultMessageHandler), which uses qMessageFormatString to construct a string, and then platform-dependent methods to print this out. This means that qMessageFormatString's newline is the one that separates debug messages. Unfortunately, in the emergency case, we don't have this luxury of doing formatting: so just make sure to add a newline so output is readable. Change-Id: I8f7bbceb9347b6312748f0f426feebaf04f6a226 Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 1cd11ad667..4d564b09c3 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -184,14 +184,14 @@ static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) Q_DECL OutputDebugStringW(emergency_bufL); # else if (qWinLogToStderr()) { - fprintf(stderr, "%s", emergency_buf); + fprintf(stderr, "%s\n", emergency_buf); fflush(stderr); } else { OutputDebugStringA(emergency_buf); } # endif #else - fprintf(stderr, "%s", emergency_buf); + fprintf(stderr, "%s\n", emergency_buf); fflush(stderr); #endif