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 <thiago.macieira@intel.com>
This commit is contained in:
Robin Burchell 2013-09-24 00:20:56 +02:00 committed by The Qt Project
parent be8999038f
commit e8af66f906

View File

@ -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