/** * {@inheritDoc} */ public function onBootstrap(EventInterface $event) { /** * @var ModuleOptions $moduleOptions */ $moduleOptions = $event->getTarget()->getServiceManager()->get('LemoTracy\\Options\\ModuleOptions'); if (true === $moduleOptions->getEnabled()) { if (null !== $moduleOptions->getMode()) { Debugger::enable($moduleOptions->getMode()); } if (null !== $moduleOptions->getLogDirectory()) { Debugger::$logDirectory = $moduleOptions->getLogDirectory(); } if (null !== $moduleOptions->getLogSeverity()) { Debugger::$logSeverity = $moduleOptions->getLogSeverity(); } if (null !== $moduleOptions->getMaxDepth()) { Debugger::$maxDepth = $moduleOptions->getMaxDepth(); } if (null !== $moduleOptions->getMaxLen()) { Debugger::$maxLen = $moduleOptions->getMaxLen(); } if (null !== $moduleOptions->getShowBar()) { Debugger::$showBar = $moduleOptions->getShowBar(); } if (null !== $moduleOptions->getStrict()) { Debugger::$strictMode = $moduleOptions->getStrict(); } } }
/** * @param Container $app * * @return mixed * * @throws DependencyInstanceNotFound */ public function register(Container $app) { /** @var Application $app */ $config = $this->config; // this service provider will quietly fail if Tracy is not installed. if (class_exists('\\Tracy\\Debugger') and $config->get('logging.tracy.enabled')) { // use the environment to configure the Debugger $env = env('APP_ENV') === 'PRODUCTION' ? Debugger::PRODUCTION : Debugger::DEVELOPMENT; Debugger::$maxDepth = $config->get('logging.tracy.maxDepth', 6); Debugger::enable($env, rtrim($config->get('logging.logPath', LOGS), '/')); Debugger::$showLocation = env('DEBUG') and $config->get('logging.tracy.showLocation', FALSE); Debugger::$strictMode = $config->get('logging.tracy.strictMode', FALSE); Debugger::$showBar = FALSE; # env('DEBUG'); // use the Tracy Debugger for logging. $app['tracy'] = Debugger::getLogger(); $app['nine.logger'] = function ($app) { return $app['tracy']; }; } }