8000 [MonologBridge] Fix Monolog/Logger final deprecation by joaojacome · Pull Request #49759 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[MonologBridge] Fix Monolog/Logger final deprecation #49759

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

Closed

Conversation

joaojacome
Copy link
@joaojacome joaojacome commented Mar 21, 2023
Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? yes
Tickets Fix #47096
License MIT

Updated MonologBridge\Logger so it doesn't extend Monolog\Logger

This shouldn't break any BC. An adapter for the public Monolog\Logger methods has been created as a trait. The trait has been created as "deprecated", so it can be removed later.

This change depends on a change in the upstream Monolog class. An MR has been opened for monolog to cover that. (Seldaek/monolog#1796)

This shouldn't break any BC. An adapter for the public Monolog\Logger methods has been created as a trait. The trait has been created as "deprecated", so it can be removed later.

This change depends on a change in the upstream Monolog class. An MR has been opened for monolog to cover that
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.3" but it seems your PR description refers to branch "6.3 (maybe 6.2?)".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@carsonbot carsonbot changed the title draft: [MonologBridge] Fix Monolog/Logger final deprecation [MonologBridge] draft: Fix Monolog/Logger final deprecation Mar 21, 2023
@joaojacome joaojacome changed the title [MonologBridge] draft: Fix Monolog/Logger final deprecation [MonologBridge] Fix Monolog/Logger final deprecation Mar 22, 2023
@xabbuh
Copy link
Member
xabbuh commented Mar 25, 2023

This would still break cases where objects of this class are passed around but the called code expects an instance of Monolog's Logger class (which we now no longer would extend).

@joaojacome
Copy link
Author
joaojacome commented Mar 25, 2023 via email

@xabbuh
Copy link
Member
xabbuh commented Mar 25, 2023

There are still two paint points with that solution:

  • the deprecation about the Logger class from Monolog class would not go away
  • How can we communicate that the class will no longer extend Monolog's Logger class in 7.0 (i.e. trigger a proper deprecation) so that people can prepare their applications?

@joaojacome
Copy link
Author

the deprecation about the Logger class from Monolog class would not go away

It wouldn't go away for the next minor versions, but with a clear idea of when its going to be fixed.

How can we communicate that the class will no longer extend Monolog's Logger class in 7.0 (i.e. trigger a proper deprecation) so that people can prepare their applications?

I'm not sure tbh. The best solution I see is to deprecate the entire class, and replace it with something like "SymfonyLogger". Besides that, I've pushed a few changes that, from my point of view, would be enough to trigger a deprecation when extending the original Monolog\Logger.

@derrabus
Copy link
Member

I don't think that this is the right approach. Why do we need the Symfony\Bridge\Monolog\Logger class at all? It is used to find the debug logger which is buried somewhere in the log processor stack. If we wire the debug logger into the profiler directly, the whole class would be obsolete.

Comment on lines +51 to +57
"minimum-stability": "dev",
"repositories": [
{
"type": "vcs",
"url": "git@github.com:joaojacome/monolog"
}
]
Copy link
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
"minimum-stability": "dev",
"repositories": [
{
"type": "vcs",
"url": "git@github.com:joaojacome/monolog"
}
]
"minimum-stability": "dev"

possibly unintended highjack of the monoglog-bridge installation by source :)

Copy link
Author

Choose a reason for hiding this comment

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

ah this was intended - this fix depends on a change in Monolog. This would be removed if this MR (and the Monolog one) were to be accepted.

@stof
Copy link
Member
stof commented May 10, 2023

the right fix is to deprecate the MonologBridge Logger class and use the Monolog Logger directly for the logger. I will soon open a PR on MonologBundle to stop using that class (which will remove the deprecation warning as the class won't be used anymore and will allow deprecating the class in Symfony 6.4)

@derrabus derrabus closed this Sep 28, 2023
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.

MonologBridge shows deprecation error with Monolog 3.2
7 participants
0