Moving Profiling to class

This commit is contained in:
Philipp Holzer 2019-02-28 09:41:31 +01:00 committed by Hypolite Petovan
parent 4810ca570f
commit 25b6db6aca
9 changed files with 214 additions and 481 deletions

View file

@ -30,7 +30,7 @@ class DependencyFactory
$config = Factory\ConfigFactory::createConfig($configCache);
// needed to call PConfig::init()
Factory\ConfigFactory::createPConfig($configCache);
$logger = Factory\LoggerFactory::create($channel, $config);
$logger = Factory\LoggerFactory::create($channel, $config, $profiler);
Factory\LoggerFactory::createDev($channel, $config);
return new App($basePath, $config, $logger, $profiler, $isBackend);

View file

@ -38,13 +38,14 @@ class LoggerFactory
*
* @param string $channel The channel of the logger instance
* @param Configuration $config The config
* @param Profiler $profiler The profiler of the app
*
* @return LoggerInterface The PSR-3 compliant logger instance
*
* @throws \Exception
* @throws InternalServerErrorException
*/
public static function create($channel, Configuration $config)
public static function create($channel, Configuration $config, Profiler $profiler)
{
if (empty($config->get('system', 'debugging', false))) {
$logger = new VoidLogger();
@ -58,7 +59,7 @@ class LoggerFactory
case 'syslog':
$level = $config->get('system', 'loglevel');
$logger = new SyslogLogger($channel, $introspection, $level);
$logger = new SyslogLogger($channel, $introspection, $profiler, $level);
break;
case 'monolog':
default: