summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2014-08-02 20:15:33 +0200
committerOlivier Goffart <ogoffart@woboq.com>2014-08-05 16:52:34 +0200
commit27b67c5399bc068b4bff34dc53b07b0f6b277617 (patch)
tree7b5c432f1fdc8d80721a1b88501444cbc9a845a2 /src/corelib/global/qlogging.cpp
parentdecb88693c8a7f0c073889b91151f01a850e3adf (diff)
Logging: use the known function when the first frame of the backtrace is unknown
Change-Id: Ia591805c82e7bf77dc7af04f1054c7daca58eb6a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
-rw-r--r--src/corelib/global/qlogging.cpp10
1 files changed, 7 insertions, 3 deletions
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)