mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 19:57:41 +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)
|
protected function write(array $record)
|
||||||
{
|
{
|
||||||
if ($this->expandNewlines) {
|
if (!$this->expandNewlines) {
|
||||||
$lines = preg_split('{[\r\n]+}', (string) $record['formatted']);
|
|
||||||
foreach ($lines as $line) {
|
|
||||||
error_log($line, $this->messageType);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
error_log((string) $record['formatted'], $this->messageType);
|
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