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

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.

@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 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

2 participants