Closed jonaseberle closed 1 year ago
@jonaseberle Good point. I have implemented the common LoggerAwareInterface check for custom task. If the task implements the interface the logger gets injected. This should do the trick, right?
https://github.com/TYPO3/Surf/commit/5afa1ed6c8e7796807c843352808a60052af99bf looks good, thank you.
Expected Behavior
When extending
TYPO3\Surf\Domain\Model\Task
(abstract class Task implements LoggerAwareInterface {...}
),$this->logger
is injected and can be used.Actual Behavior
For custom tasks, the
is not enabled thus the Logger is not injected.
I have patched Surf's
services.php
(in my case my custom tasks are in ./src on the same level ascomposer.json
)I don't know how this could be solved for all custom tasks though in a way that does not rely on the specific path.
Steps to Reproduce the Problem
$this->logger->...
Specifications
Reference: https://docs.typo3.org/other/typo3/surf/main/en-us/Tasks/Index.html