Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Workaround logging.LogRecord.msg type of str #133

Merged
merged 2 commits into from
Jul 8, 2022

Conversation

bringhurst
Copy link
Contributor

@bringhurst bringhurst commented Feb 6, 2022

I would love to avoid doing this, but I can't seem to find a nicer alternative (without changing the API). Any thoughts on alternatives would her appreciated.

Note that this may be a breaking change for typed code. They'll need a "# type: ignore" comment if they want to pass in something other than a LogRecord and exercise this functionality.

See the related comment over at: #118 (comment)

Note that logging.LogRecord.msg and logging.LogRecord.message are both type of str in typeshed (https://github.com/python/typeshed/blob/b88a6f19cdcf031be8135941b940f839e13064d8/stdlib/logging/__init__.pyi#L343) , but we treat them as (optional) dicts here.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@madzak madzak merged commit bd7417e into madzak:master Jul 8, 2022
@bringhurst bringhurst deleted the unused-very-custom branch November 21, 2022 17:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants