mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Improved ConsoleLogger to support running in watcher (#7033)
This commit is contained in:
parent
0fed0fd0a3
commit
1c295f204a
@ -1,5 +1,9 @@
|
||||
# v3.1.39 - TBD
|
||||
|
||||
## Optimized
|
||||
|
||||
- [#7033](https://github.com/hyperf/hyperf/pull/7033) Improved `ConsoleLogger` to support running in watcher.
|
||||
|
||||
# v3.1.38 - 2024-08-29
|
||||
|
||||
## Added
|
||||
|
@ -31,7 +31,13 @@ class ConsoleLogger extends SymfonyConsoleLogger implements StdoutLoggerInterfac
|
||||
in_array('-vvv', $argv) => OutputInterface::VERBOSITY_DEBUG,
|
||||
in_array('-vv', $argv) => OutputInterface::VERBOSITY_VERY_VERBOSE,
|
||||
in_array('-v', $argv) => OutputInterface::VERBOSITY_VERBOSE,
|
||||
default => OutputInterface::VERBOSITY_NORMAL,
|
||||
default => match ((int) getenv('SHELL_VERBOSITY')) {
|
||||
-1 => OutputInterface::VERBOSITY_QUIET,
|
||||
1 => OutputInterface::VERBOSITY_VERBOSE,
|
||||
2 => OutputInterface::VERBOSITY_VERY_VERBOSE,
|
||||
3 => OutputInterface::VERBOSITY_DEBUG,
|
||||
default => OutputInterface::VERBOSITY_NORMAL,
|
||||
},
|
||||
};
|
||||
})()
|
||||
);
|
||||
|
@ -125,13 +125,18 @@ class Watcher
|
||||
$this->channel->pop();
|
||||
$this->output->writeln('Start server ...');
|
||||
|
||||
$descriptorspec = [
|
||||
$descriptorSpec = [
|
||||
0 => STDIN,
|
||||
1 => STDOUT,
|
||||
2 => STDERR,
|
||||
];
|
||||
|
||||
proc_open($this->option->getBin() . ' ' . BASE_PATH . '/' . $this->option->getCommand(), $descriptorspec, $pipes);
|
||||
proc_open(
|
||||
$this->option->getBin() . ' ' . BASE_PATH . '/' . $this->option->getCommand(),
|
||||
$descriptorSpec,
|
||||
$pipes,
|
||||
env_vars: $_ENV
|
||||
);
|
||||
|
||||
$this->output->writeln('Stop server success.');
|
||||
$this->channel->push(1);
|
||||
|
Loading…
Reference in New Issue
Block a user