Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate callable loggers #462

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Dec 18, 2023

We should not invent our own contract for logging. There's PSR-3 for that.

This PR proposes to deprecate passing a callable to AbstractExecutor::setLogger() in favor of a PSR-3 logger.

I've also deprecated the public AbstractExecutor::log() method because I believe that the executor should not act as a logger.

Note that logging was not covered by tests at all, so the large part of this PR was actually adding tests. 🙈

See #455 (comment) for a discussion.

@derrabus
Copy link
Member Author

cc @GromNaN

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The command doctrine:fixtures:load will need an update to inject a Symfony\Component\Console\Logger\ConsoleLogger instead. The output will become more verbose.

@derrabus derrabus merged commit 2b3f3be into doctrine:1.8.x Mar 8, 2024
13 checks passed
@derrabus derrabus deleted the deprecate/callable-logger branch March 8, 2024 08:04
derrabus added a commit to derrabus/data-fixtures that referenced this pull request Mar 8, 2024
* 1.8.x:
  Deprecate callable loggers (doctrine#462)
@derrabus derrabus mentioned this pull request Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants