From 61adfea1961e40a47702dbe8253a618ccf64ca66 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 17 Jun 2022 23:54:38 +0800 Subject: [PATCH] Fix garbage text appeared in log file Fix up fed969ed64f7812a5e0cc65e554c974e914b9074. --- src/app/filelogger.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/filelogger.cpp b/src/app/filelogger.cpp index 3cd5e6ac1..4ef616a08 100644 --- a/src/app/filelogger.cpp +++ b/src/app/filelogger.cpp @@ -134,19 +134,19 @@ void FileLogger::addLogMessage(const Log::Msg &msg) switch (msg.type) { case Log::INFO: - stream << u"(I) "; + stream << QStringView(u"(I) "); break; case Log::WARNING: - stream << u"(W) "; + stream << QStringView(u"(W) "); break; case Log::CRITICAL: - stream << u"(C) "; + stream << QStringView(u"(C) "); break; default: - stream << u"(N) "; + stream << QStringView(u"(N) "); } - stream << QDateTime::fromMSecsSinceEpoch(msg.timestamp).toString(Qt::ISODate) << u" - " << msg.message << u'\n'; + stream << QDateTime::fromMSecsSinceEpoch(msg.timestamp).toString(Qt::ISODate) << QStringView(u" - ") << msg.message << QChar(u'\n'); if (m_backup && (m_logFile.size() >= m_maxSize)) {