Skip to content

Commit

Permalink
BUG: Fix substitution problems in logs when the log message contains …
Browse files Browse the repository at this point in the history
…a % symbol.
  • Loading branch information
Woundorf committed Jul 5, 2022
1 parent e24b190 commit 4d5b08c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions starviewer/src/core/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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&)
Expand All @@ -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&)
Expand Down

0 comments on commit 4d5b08c

Please sign in to comment.