mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
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:
@@ -73,9 +73,26 @@ class CLI extends Application
|
|||||||
|
|
||||||
$this->bindRoutes();
|
$this->bindRoutes();
|
||||||
|
|
||||||
$this['logger'] = $this->extend('logger', function () {
|
$logger = false;
|
||||||
return new Console\Logger\ConsoleLogger(new Console\Output\ConsoleOutput(Console\Output\ConsoleOutput::VERBOSITY_DEBUG));
|
|
||||||
});
|
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);
|
error_reporting(-1);
|
||||||
ErrorHandler::register();
|
ErrorHandler::register();
|
||||||
|
Reference in New Issue
Block a user