1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-01 19:00:20 +02:00

Minor code cleanup on Handler/ErrorLogHandler.php (#995)

Just some cleanup for readability.
This commit is contained in:
Westin Shafer
2017-06-18 18:49:55 -06:00
committed by Jordi Boggiano
parent 1417e2d183
commit 443e4a94fc

View File

@@ -71,13 +71,14 @@ class ErrorLogHandler extends AbstractProcessingHandler
*/
protected function write(array $record)
{
if ($this->expandNewlines) {
$lines = preg_split('{[\r\n]+}', (string) $record['formatted']);
foreach ($lines as $line) {
error_log($line, $this->messageType);
}
} else {
if (!$this->expandNewlines) {
error_log((string) $record['formatted'], $this->messageType);
return;
}
$lines = preg_split('{[\r\n]+}', (string) $record['formatted']);
foreach ($lines as $line) {
error_log($line, $this->messageType);
}
}
}