diff --git a/composer.json b/composer.json index 9744b92..9c25efb 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "zhamao/logger", - "description": "Another Console Logger for CLI Applications", + "description": "Another Colorful Console Logger for CLI Applications", "type": "library", "license": "Apache-2.0", "autoload": { @@ -16,7 +16,7 @@ "authors": [ { "name": "jerry", - "email": "admin@zhamao.me" + "email": "github@cwcc.me" }, { "name": "sunxyw", diff --git a/src/ZM/Logger/ConsoleLogger.php b/src/ZM/Logger/ConsoleLogger.php index b445ca0..235798c 100644 --- a/src/ZM/Logger/ConsoleLogger.php +++ b/src/ZM/Logger/ConsoleLogger.php @@ -243,8 +243,12 @@ class ConsoleLogger extends AbstractLogger fwrite($this->stream, $output); fflush($this->stream); } else { - // use plain text output - echo $output; + if ($level <= 4 && $this->use_stderr) { + fwrite(STDERR, $output); + } else { + // use plain text output + echo $output; + } } }