From 4d5b08cfcc87f1e3b7299ea29d6e58d64fdcd285 Mon Sep 17 00:00:00 2001 From: Marc Ruiz Date: Tue, 5 Jul 2022 22:03:15 +0200 Subject: [PATCH] BUG: Fix substitution problems in logs when the log message contains a % symbol. --- starviewer/src/core/logging.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/starviewer/src/core/logging.cpp b/starviewer/src/core/logging.cpp index d3776d1165..bd98de34ba 100644 --- a/starviewer/src/core/logging.cpp +++ b/starviewer/src/core/logging.cpp @@ -76,7 +76,7 @@ QString getLogConfFilePath() void debugLog(const QString &msg, const QString &file, int line, const QString &function) { - LOG(DEBUG) << qPrintable(QString("%1 [ %2:%3 %4 ]").arg(msg).arg(file).arg(line).arg(function)); + LOG(DEBUG) << qPrintable(QString("%1 [ %2:%3 %4 ]").arg(msg, file, QString::number(line), function)); } void infoLog(const QString &msg, const QString&, int, const QString&) @@ -86,17 +86,17 @@ void infoLog(const QString &msg, const QString&, int, const QString&) void warnLog(const QString &msg, const QString &file, int line, const QString &function) { - LOG(WARNING) << qUtf8Printable(QString("%1 [ %2:%3 %4 ]").arg(msg).arg(file).arg(line).arg(function)); + LOG(WARNING) << qUtf8Printable(QString("%1 [ %2:%3 %4 ]").arg(msg, file, QString::number(line), function)); } void errorLog(const QString &msg, const QString &file, int line, const QString &function) { - LOG(ERROR) << qUtf8Printable(QString("%1 [ %2:%3 %4 ]").arg(msg).arg(file).arg(line).arg(function)); + LOG(ERROR) << qUtf8Printable(QString("%1 [ %2:%3 %4 ]").arg(msg, file, QString::number(line), function)); } void fatalLog(const QString &msg, const QString &file, int line, const QString &function) { - LOG(FATAL) << qUtf8Printable(QString("%1 [ %2:%3 %4 ]").arg(msg).arg(file).arg(line).arg(function)); + LOG(FATAL) << qUtf8Printable(QString("%1 [ %2:%3 %4 ]").arg(msg, file, QString::number(line), function)); } void verboseLog(int vLevel, const QString &msg, const QString&, int, const QString&)