Skip to content
Snippets Groups Projects
Commit 85917dd3 authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[FEATURE] Support autowired LoggerInterface injection

Logger instances may be required to be available during object
construction, LoggerAwareInterface isn't an option in that case.
Therefore LoggerInterface as constructor argument is now
autowired (if the service is configured to use autowiring)
and instantiated with an object-specific logger.

We add a symfony compiler pass that prepares an inline factory which
fetches the appropriate Logger instance from the LogManager.
One of the TYPO3 core classes that require this is the Scheduler.

Scheduler used to contain a safety net which fetches a logger instance
from LogManager in case the logger is already needed during the
constructor invocation. In that case the logger was not available, as it
was injected via setter injection (setLogger) later
(per LoggerAwareInterface).

Releases: master
Resolves: #95044
Change-Id: I57539a731a305da6abc092d2383e2d2f4c1d985c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65449


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: default avatarBenjamin Franzke <bfr@qbus.de>
parent 9ccd9312
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment