From 27b67c5399bc068b4bff34dc53b07b0f6b277617 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 2 Aug 2014 20:15:33 +0200 Subject: Logging: use the known function when the first frame of the backtrace is unknown Change-Id: Ia591805c82e7bf77dc7af04f1054c7daca58eb6a Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart --- src/corelib/global/qlogging.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 013efec3d5..465e2a4b45 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1161,10 +1161,14 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con if (numberPrinted > 0) message.append(pattern->backtraceSeparator); - if (function.isEmpty()) - message += QLatin1Char('?') + library + QLatin1Char('?'); - else + if (function.isEmpty()) { + if (numberPrinted == 0 && context.function) + message += QString::fromUtf8(qCleanupFuncinfo(context.function)); + else + message += QLatin1Char('?') + library + QLatin1Char('?'); + } else { message += function; + } } else { if (numberPrinted == 0) -- cgit v1.2.3