From 5bfe794aaab34d6aa021b5640972509e3bc6ced8 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 16 Oct 2014 15:12:59 +0200 Subject: Remove trailing '\n' in qFormatLogMessage output Do not automatically add a \n to all messages formatted by qFormatLogMessage. Some backends require a final newline, some don't, so it's best to only append it where it's actually needed. The returned string will be null if the pattern is empty. This allows to differentiate between the case that the pattern just didn't apply (empty line is printed), and the case that qSetMessagePattern(QString()) have been called (nothing is printed). Change-Id: I17fde997a4074f58f82de6dea129948155c322d6 Reviewed-by: Oswald Buddenhagen Reviewed-by: Alex Blasche --- src/testlib/qtestlog.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/testlib/qtestlog.cpp') diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 7ea953232f..e48fdc1ad0 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -279,7 +279,6 @@ namespace QTest { return; QString msg = qFormatLogMessage(type, context, message); - msg.chop(1); // remove trailing newline if (type != QtFatalMsg) { if (counter.load() <= 0) -- cgit v1.2.3