From d740574bd435390172a9f6f07ec1468261432b30 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 7 Apr 2025 10:43:46 +0100 Subject: [PATCH] fix: Remove unnecessary log line endings and trimming --- src/lib/gui/Logger.cpp | 4 +--- src/lib/gui/MainWindow.cpp | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/gui/Logger.cpp b/src/lib/gui/Logger.cpp index 52f852ce0..37d57d491 100644 --- a/src/lib/gui/Logger.cpp +++ b/src/lib/gui/Logger.cpp @@ -32,10 +32,8 @@ QString printLine(FILE *out, const QString &type, const QString &message, const auto logLine = QString("[%1] %2: %3").arg(datetime, type, message); QTextStream stream(&logLine); - stream << Qt::endl; - if (!fileLine.isEmpty()) { - stream << "\t" + fileLine << Qt::endl; + stream << "\n\t" + fileLine; } auto logLineBytes = logLine.toUtf8(); diff --git a/src/lib/gui/MainWindow.cpp b/src/lib/gui/MainWindow.cpp index 12ee3af0f..340f87547 100644 --- a/src/lib/gui/MainWindow.cpp +++ b/src/lib/gui/MainWindow.cpp @@ -729,9 +729,8 @@ void MainWindow::handleLogLine(const QString &line) int maxScroll = verticalScroll->maximum(); const auto scrollAtBottom = qAbs(currentScroll - maxScroll) <= kScrollBottomThreshold; - // only trim end instead of the whole line to prevent tab-indented debug - // filenames from losing their indentation. - ui->textLog->appendPlainText(line.trimmed()); + // Never trim the log line; doing so would hide underlying bugs where newlines and space is added unintentionally. + ui->textLog->appendPlainText(line); if (scrollAtBottom) { verticalScroll->setValue(verticalScroll->maximum());