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

Rename LogRecord type alias to LogDict #38

Open
FichteFoll opened this issue Dec 17, 2024 · 1 comment
Open

Rename LogRecord type alias to LogDict #38

FichteFoll opened this issue Dec 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@FichteFoll
Copy link

The fact that LogRecord is defined as a type alias that is not logging.LogRecord while logging.LogRecord is also thrown around (e.g. in add_fields) is very confusing.

LogRecord: TypeAlias = Dict[str, Any]

I strongly advise to pick a different name for this to differentiate it from the logging class, for example LogDict. This is also a strong contender for v4 imo.

@nhairs
Copy link
Owner

nhairs commented Dec 18, 2024

This is a good proposal. Even when refactoring I had issues keeping track which type of object I was working with (which I why I ended up adding the type alias in the first place).

If we are making breaking changes it might be worth changing some of the arguments as well so it's clear what is what. Maybe log_dict + LogDict and record + logging.LogRecord.

@nhairs nhairs added the enhancement New feature or request label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants