mirror of
https://github.com/friendica/friendica
synced 2025-04-24 03:50:12 +00:00
Moving Profiling to class
This commit is contained in:
parent
4810ca570f
commit
25b6db6aca
9 changed files with 214 additions and 481 deletions
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue