fix: Remove unnecessary log line endings and trimming
This commit is contained in:
parent
84ae597d69
commit
d740574bd4
2 changed files with 3 additions and 6 deletions
|
|
@ -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);
|
auto logLine = QString("[%1] %2: %3").arg(datetime, type, message);
|
||||||
|
|
||||||
QTextStream stream(&logLine);
|
QTextStream stream(&logLine);
|
||||||
stream << Qt::endl;
|
|
||||||
|
|
||||||
if (!fileLine.isEmpty()) {
|
if (!fileLine.isEmpty()) {
|
||||||
stream << "\t" + fileLine << Qt::endl;
|
stream << "\n\t" + fileLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto logLineBytes = logLine.toUtf8();
|
auto logLineBytes = logLine.toUtf8();
|
||||||
|
|
|
||||||
|
|
@ -729,9 +729,8 @@ void MainWindow::handleLogLine(const QString &line)
|
||||||
int maxScroll = verticalScroll->maximum();
|
int maxScroll = verticalScroll->maximum();
|
||||||
const auto scrollAtBottom = qAbs(currentScroll - maxScroll) <= kScrollBottomThreshold;
|
const auto scrollAtBottom = qAbs(currentScroll - maxScroll) <= kScrollBottomThreshold;
|
||||||
|
|
||||||
// only trim end instead of the whole line to prevent tab-indented debug
|
// Never trim the log line; doing so would hide underlying bugs where newlines and space is added unintentionally.
|
||||||
// filenames from losing their indentation.
|
ui->textLog->appendPlainText(line);
|
||||||
ui->textLog->appendPlainText(line.trimmed());
|
|
||||||
|
|
||||||
if (scrollAtBottom) {
|
if (scrollAtBottom) {
|
||||||
verticalScroll->setValue(verticalScroll->maximum());
|
verticalScroll->setValue(verticalScroll->maximum());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue