1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-26 10:06:10 +01:00

Avoid empty espace on empty trace (#1979)

This commit is contained in:
angeljqv
2025-10-23 13:27:47 -05:00
committed by GitHub
parent 4b718aed6a
commit 62366ef23b

View File

@@ -303,6 +303,10 @@ class LineFormatter extends NormalizerFormatter
$trace = str_replace("\n", "\n{$this->indentStacktraces}", $trace); $trace = str_replace("\n", "\n{$this->indentStacktraces}", $trace);
} }
if (trim($trace) === '') {
return '';
}
return "\n{$this->indentStacktraces}[stacktrace]\n{$this->indentStacktraces}" . $trace . "\n"; return "\n{$this->indentStacktraces}[stacktrace]\n{$this->indentStacktraces}" . $trace . "\n";
} }