Merge pull request #3005 from MilosEsokia/PHRAS-2529_enable_debug_depending_on_environment

PHRAS-2529 Enable console debug depending on environment
This commit is contained in:
Nicolas Maillat
2019-05-21 10:26:58 +02:00
committed by GitHub

View File

@@ -73,9 +73,26 @@ class CLI extends Application
$this->bindRoutes();
$logger = false;
if ($this['configuration.store']->isSetup()){
$config = $this['configuration.store']->getConfig();
if ((isset($config['console_logger_enabled_environments']) && in_array($environment, $config['console_logger_enabled_environments']))){
$logger = true;
}
}
if ($environment == self::ENV_DEV){
$logger = true;
}
if ($logger){
$this['logger'] = $this->extend('logger', function () {
return new Console\Logger\ConsoleLogger(new Console\Output\ConsoleOutput(Console\Output\ConsoleOutput::VERBOSITY_DEBUG));
});
}
error_reporting(-1);
ErrorHandler::register();