Repository navigation
[zend-log] log deprecations with DEBUG priority, as documented - #240
Open
falkenhawk wants to merge 2 commits into
Open
falkenhawk wants to merge 2 commits into
falkenhawk wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
followup to #205
Zend_Log::registerErrorHandler()should logE_DEPRECATED,E_USER_DEPRECATEDandE_STRICTwith theDEBUGpriority, as its docblock says.They are logged as
INFOinstead:The priority map is keyed by error level, but these levels were added with their names as strings (
'E_DEPRECATED').The error handler looks the priority up by the error level number, finds nothing and falls back to
INFO, the priority for unknown errors.This has been there since
registerErrorHandler()was added (ZF-9192, zendframework/zf1).#205 moved
E_STRICTinto the same pattern, so since 1.16.0E_STRICTis logged asINFOon php 7 too.Fix
The map uses the constants as keys again.
E_STRICTis only added below php 8.4, where using the constant is not deprecated. php 8 never raisesE_STRICTanyway.The fix is carried over from zf1-future, Shardj/zf1-future#485.
Behavior change
Deprecations are now logged with
DEBUG(7) instead ofINFO(6), as documented.A writer that only logs
INFOand above, e.g. withZend_Log_Filter_Priority(Zend_Log::INFO), no longer writes them.On php 8 deprecations can be a large part of what the error handler logs, so this should be mentioned in the changelog.
Ported from a private repository, based on work by @marcing.