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

Normalize DIRECTORY_SEPARATOR on file traces(exceptions) (#1980)

This commit is contained in:
angeljqv
2025-10-23 15:02:18 -05:00
committed by GitHub
parent 6b44f0a064
commit 095bf11b27

View File

@@ -278,7 +278,7 @@ class LineFormatter extends NormalizerFormatter
$file = preg_replace('{^'.preg_quote($this->basePath).'}', '', $file);
}
$str .= '): ' . $e->getMessage() . ' at ' . $file . ':' . $e->getLine() . ')';
$str .= '): ' . $e->getMessage() . ' at ' . strtr((string) $file, DIRECTORY_SEPARATOR, '/') . ':' . $e->getLine() . ')';
if ($this->includeStacktraces) {
$str .= $this->stacktracesParser($e);
@@ -307,7 +307,7 @@ class LineFormatter extends NormalizerFormatter
return '';
}
return "\n{$this->indentStacktraces}[stacktrace]\n{$this->indentStacktraces}" . $trace . "\n";
return "\n{$this->indentStacktraces}[stacktrace]\n{$this->indentStacktraces}" . strtr($trace, DIRECTORY_SEPARATOR, '/') . "\n";
}
private function stacktracesParserCustom(string $trace): string