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

log method not PSR-3 compliant #97

Open
gian-hancock opened this issue Aug 27, 2019 · 1 comment
Open

log method not PSR-3 compliant #97

gian-hancock opened this issue Aug 27, 2019 · 1 comment

Comments

@gian-hancock
Copy link

The PSR-3 specification states:

A ninth method, log, accepts a log level as the first argument. Calling this method with one of the log level constants MUST have the same result as calling the level-specific method. Calling this method with a level not defined by this specification MUST throw a Psr\Log\InvalidArgumentException if the implementation does not know about the level. Users SHOULD NOT use a custom level without knowing for sure the current implementation supports it.

Currently calling log with any level not specified in PSR-3 will write the log regardless of the current log threshold and give an undefined index notice.

@gian-hancock
Copy link
Author

If it is intentional that the log method accepts arbitrary log levels, then it could be argued that this implementation "knows about" all log levels and therefore is PSR-3 compliant. In this case it could be documented and the code updated so that notices aren't generated. However it would still be true that the log level threshold would have no effect on non PSR-3 log levels.

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

No branches or pull requests

1 participant