[WebServerBundle] fixed server:log when Monolog is not installed
This commit is contained in:
parent
133c37a9a3
commit
9d56f0cf7d
@ -29,10 +29,24 @@ class ServerLogCommand extends Command
|
||||
private $el;
|
||||
private $handler;
|
||||
|
||||
public function isEnabled()
|
||||
{
|
||||
if (!class_exists(ConsoleFormatter::class)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::isEnabled();
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this->setName('server:log');
|
||||
|
||||
if (!class_exists(ConsoleFormatter::class)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this
|
||||
->setName('server:log')
|
||||
->setDescription('Start a log server that displays logs in real time')
|
||||
->addOption('host', null, InputOption::VALUE_REQUIRED, 'The server host', '0:9911')
|
||||
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The line format', ConsoleFormatter::SIMPLE_FORMAT)
|
||||
|
Reference in New Issue
Block a user