mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +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',
|
OutputInterface::VERBOSITY_VERY_VERBOSE, OutputInterface::VERBOSITY_DEBUG => 'debug',
|
||||||
default => 'warning',
|
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);
|
logger()->setLevel($level);
|
||||||
|
|
||||||
// ansi
|
// ansi
|
||||||
@ -95,7 +103,7 @@ abstract class BaseCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set debug mode in ApplicationContext
|
// Set debug mode in ApplicationContext
|
||||||
$isDebug = $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
|
$isDebug = $isDebug ?: $this->output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG;
|
||||||
ApplicationContext::setDebug($isDebug);
|
ApplicationContext::setDebug($isDebug);
|
||||||
|
|
||||||
// show raw argv list for logger()->debug
|
// show raw argv list for logger()->debug
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user