mirror of
https://github.com/zhamao-robot/zhamao-logger.git
synced 2026-07-02 14:25:40 +08:00
Enhance output handling in ConsoleLogger to use STDERR for specific log levels
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "zhamao/logger",
|
"name": "zhamao/logger",
|
||||||
"description": "Another Console Logger for CLI Applications",
|
"description": "Another Colorful Console Logger for CLI Applications",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "jerry",
|
"name": "jerry",
|
||||||
"email": "admin@zhamao.me"
|
"email": "github@cwcc.me"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sunxyw",
|
"name": "sunxyw",
|
||||||
|
|||||||
@@ -243,8 +243,12 @@ class ConsoleLogger extends AbstractLogger
|
|||||||
fwrite($this->stream, $output);
|
fwrite($this->stream, $output);
|
||||||
fflush($this->stream);
|
fflush($this->stream);
|
||||||
} else {
|
} else {
|
||||||
// use plain text output
|
if ($level <= 4 && $this->use_stderr) {
|
||||||
echo $output;
|
fwrite(STDERR, $output);
|
||||||
|
} else {
|
||||||
|
// use plain text output
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user