diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-08-19 15:15:11 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-08-19 15:15:11 +0300 |
commit | baec74598a8a57af403c35af40e7ea46570307d6 (patch) | |
tree | f4a675d82c594cfe2bdd04211703828186bc651b /plugins/Monolog/config | |
parent | 496bbbd15239c6cfa160679b2aa51cefa55b6fdb (diff) |
fix a system test
Diffstat (limited to 'plugins/Monolog/config')
-rw-r--r-- | plugins/Monolog/config/tracker.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/Monolog/config/tracker.php b/plugins/Monolog/config/tracker.php index 22e06bb1f1..c9d0044b35 100644 --- a/plugins/Monolog/config/tracker.php +++ b/plugins/Monolog/config/tracker.php @@ -2,11 +2,16 @@ use Interop\Container\ContainerInterface; +function isTrackerDebugEnabled(ContainerInterface $c) +{ + $trackerDebug = $c->get("ini.Tracker.debug"); + return ($trackerDebug == 1 || !empty($GLOBALS['PIWIK_TRACKER_DEBUG'])); +} + return array( 'Psr\Log\LoggerInterface' => function (ContainerInterface $c) { - $trackerDebug = $c->get("ini.Tracker.debug"); - if ($trackerDebug == 1 || !empty($GLOBALS['PIWIK_TRACKER_DEBUG'])) { + if (isTrackerDebugEnabled($c)) { return $c->get('Monolog\Logger'); } else { return new \Psr\Log\NullLogger(); @@ -21,8 +26,12 @@ return array( return $previous; }), - 'log.level' => DI\factory(function (ContainerInterface $c) { - return \Monolog\Logger::DEBUG; + 'log.level' => DI\decorate(function ($previous, ContainerInterface $c) { + if (isTrackerDebugEnabled($c)) { + return \Monolog\Logger::DEBUG; + } + + return $previous; }) ); |