addHandler(new ErrorLogHandler(Logger::DEBUG)); } else { $logger->addHandler(new ErrorLogHandler(Logger::INFO)); } // Uncomment this for info logging to fs // $logger->addHandler(new StreamHandler('/tmp/rss-bridge.txt', Logger::INFO)); // Uncomment this for debug logging to fs //$logger->addHandler(new StreamHandler('/tmp/rss-bridge-debug.txt', Logger::DEBUG)); return $logger; }; $container['cache'] = function ($c) { /** @var CacheFactory $cacheFactory */ $cacheFactory = $c['cache_factory']; $type = Configuration::getConfig('cache', 'type'); if (!$type) { throw new \Exception('No cache type configured'); } if (Debug::isEnabled()) { $cache = $cacheFactory->create('array'); } else { $cache = $cacheFactory->create($type); } return $cache; }; return $container;