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:
committed by
Jordi Boggiano
parent
1417e2d183
commit
443e4a94fc
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user