mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Deprecate '--debug' option and update logging level handling
This commit is contained in:
parent
fa175963f9
commit
7623b9e673
@ -87,6 +87,14 @@ abstract class BaseCommand extends Command
|
||||
OutputInterface::VERBOSITY_VERY_VERBOSE, OutputInterface::VERBOSITY_DEBUG => 'debug',
|
||||
default => 'warning',
|
||||
};
|
||||
$isDebug = false;
|
||||
// if '--debug' is set, override log level to debug
|
||||
if ($this->input->getOption('debug')) {
|
||||
$level = 'debug';
|
||||
logger()->warning('The --debug option is deprecated and will be removed in future versions. Please use -vv or -vvv to enable debug mode.');
|
||||
$this->output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
|
||||
$isDebug = true;
|
||||
}
|
||||
logger()->setLevel($level);
|
||||
|
||||
// ansi
|
||||
@ -95,7 +103,7 @@ abstract class BaseCommand extends Command
|
||||
}
|
||||
|
||||
// Set debug mode in ApplicationContext
|
||||
$isDebug = $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
|
||||
$isDebug = $isDebug ?: $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
|
||||
ApplicationContext::setDebug($isDebug);
|
||||
|
||||
// show raw argv list for logger()->debug
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user