Pārlūkot izejas kodu

Avoid empty espace on empty trace (#1979)

angeljqv 2 mēneši atpakaļ
vecāks
revīzija
62366ef23b
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      src/Monolog/Formatter/LineFormatter.php

+ 4 - 0
src/Monolog/Formatter/LineFormatter.php

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