diff options
author | Westin Shafer <westin@havenly.com> | 2017-06-18 18:49:55 -0600 |
---|---|---|
committer | Jordi Boggiano <j.boggiano@seld.be> | 2017-06-19 02:49:55 +0200 |
commit | 443e4a94fc00711cb618b446d071b2a027395c88 (patch) | |
tree | 751be0b6ed2ceaf32be9de3fece70592acb0e1ac /src | |
parent | 1417e2d183a12996c7a626985e2c6ce32dd08b3e (diff) | |
download | monolog-443e4a94fc00711cb618b446d071b2a027395c88.zip monolog-443e4a94fc00711cb618b446d071b2a027395c88.tar.gz monolog-443e4a94fc00711cb618b446d071b2a027395c88.tar.bz2 |
Minor code cleanup on Handler/ErrorLogHandler.php (#995)
Just some cleanup for readability.
Diffstat (limited to 'src')
-rw-r--r-- | src/Monolog/Handler/ErrorLogHandler.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Monolog/Handler/ErrorLogHandler.php b/src/Monolog/Handler/ErrorLogHandler.php index b272878..2c80139 100644 --- a/src/Monolog/Handler/ErrorLogHandler.php +++ b/src/Monolog/Handler/ErrorLogHandler.php @@ -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); } } } |