Repository navigation
Don't treat message and asctime as extras in ExtraAdder - #850
Open
Debasishhh wants to merge 4 commits into
Open
Debasishhh wants to merge 4 commits into
Debasishhh wants to merge 4 commits into
Conversation
This branch has not been deployed
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.
Summary
ExtraAdderbuilds its list of standardLogRecordattributes from a freshly created record, which doesn't havemessageorasctimeyet.logging.Formatter.format()sets both on the record, so if another handler formats it beforeProcessorFormatterruns (a plain console handler next to a JSON one, pytest's caplog, etc.),ExtraAddercopies them into the event dict as if they were extras:The output also depends on handler order. Both names are reserved by
Logger.makeRecord()(it raises if you pass them inextra), so they can never be real extras. This adds them to_LOG_RECORD_KEYS, which onlyExtraAdderuses.#842 adds the same two names to a separate reserved set for
render_to_log_kwargs; this doesn't touch that code path.Pull Request Checklist
mainbranch.api.py.docs/api.rstby hand.versionadded,versionchanged, ordeprecateddirectives..rstand.mdfiles is written using semantic newlines.