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

Add support to the PSR LoggerInterface #105

Closed
wants to merge 1 commit into from

Conversation

benja-M-1
Copy link

No description provided.

@@ -18,7 +18,8 @@
"jms/metadata": "1.*",
"jms/parser-lib": "1.*",
"jms/aop-bundle": ">=1.0.0,<1.2-dev",
"jms/di-extra-bundle": "1.3.*"
"jms/di-extra-bundle": "1.3.*",
"psr/log": ">=1.0,<2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

a hard requirement on logging ? seriously ?

Copy link
Author

Choose a reason for hiding this comment

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

Yes as it replaces the LoggerInterface of the HttpKernel Symfony component. Why does this sound like a bad idea to you?

Copy link
Contributor

Choose a reason for hiding this comment

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

The point is, is the logger a required dependency of the library ?

Copy link
Author

Choose a reason for hiding this comment

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

Yes as it is used in many use statements.

But if the dependency is not included here it will be by the FrameworkBundle wich requires the HttpKernel component wich required the psr/log. I thought it was better to require it here to make it more explicit.

Copy link
Contributor

Choose a reason for hiding this comment

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

use statement are not defining a dependency. You can put anything into a use statement. It does not trigger the autoloading.

Copy link
Contributor

Choose a reason for hiding this comment

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

and the question is whether it is a required dependency or an optional one

Copy link
Author

Choose a reason for hiding this comment

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

So it's not a dependency as Logger is always optional.

@stof
Copy link
Contributor

stof commented Jan 27, 2013

This requires branching the bundle as it will makes the logging incompatible with Symfony 2.1

@schmittjoh
Copy link
Owner

I appreciate the effort, but I'm wondering if there is a problem with the current code?

If there is one, maybe we can find a solution that does not require a BC break.

@benja-M-1
Copy link
Author

There is absolutely no problems with the code. I just did it because I was reading the code and as the LoggerInterface of Symfony will be deprecated I thought updating it would be a good thing.

There is no problem to close this right now if you want :)

@schmittjoh
Copy link
Owner

No, let's keep it open, we will need it eventually, but I'll probably not merge it for some time.

@benja-M-1
Copy link
Author

As you want. Tell me if more needs to be done.

@benja-M-1
Copy link
Author

@stof I removed the dependency to psr/log.

I wonder if I should change the min version of the framework bundle to >=2.2

@ricbra
Copy link
Contributor

ricbra commented Jan 30, 2013

Currently the tests fail because of the PSR LoggerInterface. Best solution imho is to create a new branch for 2.1.

@stof
Copy link
Contributor

stof commented Jan 30, 2013

@ricbra tests are not failing because of this change. They are failing because of reaching the github api rate limit and trying to download a file

@ricbra
Copy link
Contributor

ricbra commented Jan 30, 2013

I'm sorry for being unclear, I was trying to say the tests for this bundle are failing without this change. When I do a fresh clone, composer.phar install --dev and run the tests after that I get:

PHP Catchable fatal error:  Argument 1 passed to JMS\SecurityExtraBundle\Security\Util\SecureRandom::__construct() must be an instance of Symfony\Component\HttpKernel\Log\LoggerInterface, instance of Symfony\Component\HttpKernel\Log\NullLogger given, called in /var/www/jms2/Tests/Security/Util/SecureRandomTest.php on line 153 and defined in /var/www/jms2/Security/Util/SecureRandom.php on line 25

So my conclusion is that these problems are caused by the changes in the LoggerInterface. I don't see how this is related to github api rate? Certainly not when running the tests locally?

@stof
Copy link
Contributor

stof commented Jan 30, 2013

ah, I thought you were talkign about the failures on Travis.

and this issue is in fact a bug in Symfony 2.2 where the NullLogger misses the implements for the Symfony2 interface since the change to extend PSR-3. I will submit a fix

ondrejmirtes pushed a commit to ondrejmirtes/symfony that referenced this pull request Nov 25, 2013
This PR was merged into the master branch.

Commits
-------

b1d1168 Fixed the NullLogger to implement the HttpKernel interface again

Discussion
----------

Fixed the NullLogger to implement the HttpKernel interface again

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no (reverting one introduced by mistake)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | n/a

This BC breaking mistake has been reported in schmittjoh/JMSSecurityExtraBundle#105 (comment)
@GuilhemN
Copy link
Collaborator

GuilhemN commented Feb 3, 2016

closed in favor of #202 (comment)

@GuilhemN GuilhemN closed this Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants