mirror of
https://github.com/friendica/friendica
synced 2025-01-08 18:44:43 +00:00
Setup container with explicit LogChannel
This commit is contained in:
parent
cf8ce380b7
commit
0afa5aba63
1 changed files with 11 additions and 6 deletions
17
src/App.php
17
src/App.php
|
@ -125,6 +125,8 @@ class App
|
|||
{
|
||||
$this->setupContainerForAddons();
|
||||
|
||||
$this->setupContainerForLogger(LogChannel::DEFAULT);
|
||||
|
||||
$this->container = $this->container->addRule(Mode::class, [
|
||||
'call' => [
|
||||
['determineRunMode', [false, $request->getServerParams()], Dice::CHAIN_CALL],
|
||||
|
@ -170,9 +172,7 @@ class App
|
|||
{
|
||||
$this->setupContainerForAddons();
|
||||
|
||||
$this->container = $this->container->addRule(LoggerInterface::class,[
|
||||
'constructParams' => [LogChannel::AUTH_JABBERED],
|
||||
]);
|
||||
$this->setupContainerForLogger(LogChannel::AUTH_JABBERED);
|
||||
|
||||
$this->setupLegacyServerLocator();
|
||||
|
||||
|
@ -194,9 +194,7 @@ class App
|
|||
{
|
||||
$this->setupContainerForAddons();
|
||||
|
||||
$this->container = $this->container->addRule(LoggerInterface::class, [
|
||||
'constructParams' => [LogChannel::CONSOLE],
|
||||
]);
|
||||
$this->setupContainerForLogger(LogChannel::CONSOLE);
|
||||
|
||||
$this->setupLegacyServerLocator();
|
||||
|
||||
|
@ -213,6 +211,13 @@ class App
|
|||
$this->container = $this->container->addRules($addonLoader->getActiveAddonConfig('dependencies'));
|
||||
}
|
||||
|
||||
private function setupContainerForLogger(string $logChannel): void
|
||||
{
|
||||
$this->container = $this->container->addRule(LoggerInterface::class, [
|
||||
'constructParams' => [$logChannel],
|
||||
]);
|
||||
}
|
||||
|
||||
private function setupLegacyServerLocator(): void
|
||||
{
|
||||
\Friendica\DI::init($this->container);
|
||||
|
|
Loading…
Reference in a new issue