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

Simplify log_level() #182

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Simplify log_level() #182

wants to merge 13 commits into from

Conversation

hadley
Copy link
Collaborator

@hadley hadley commented Aug 6, 2024

Previously created a function then immediately called it. Now it just inlines the results of that function, which leads to a bunch of simplification. I think this changes suggests that we could deprecate logger() since I doubt there's much use for it outside the package.

This is technically a breaking change since it alters the return value of log_level() and friends. But the current return value was not documented, and it seems unlikely that folks would be dependent on the specific value. Still needs a NEWS bullet though.

hadley added 10 commits August 6, 2024 15:39
Previously created a function then immediately called it. Now it just inlines the results of that function, which leads to a bunch of simplification.

Waiting for daroczig#170 since otherwise `catch_base_log()` ends up setting `appender()` to something other than a function.

After this can probably deprecate `logger()` since I don't think there's much use for it outside the package anyway.
@daroczig
Copy link
Owner

daroczig commented Aug 7, 2024

Sorry, I just got to this PR.

You are absolutely right that the return value is not documented 😞
But that was explicitly requested e.g. in #26, so I think we should keep that behavior.

Let me think about this one, but I'm very open to any related thoughts.

@hadley hadley changed the title WIP: simplify log_level() Simplify log_level() Aug 7, 2024
@hadley hadley marked this pull request as ready for review August 7, 2024 21:42
@hadley
Copy link
Collaborator Author

hadley commented Aug 7, 2024

IMO the additional complexity needed to support that feature is not worth it, especially due to the difficulty (as mentioned in that thread) of exactly what the object should be if there are multiple loggers on the stack. If you really want to keep it, I'm happy to update my code to do so, but my sense would be that it's not going to affect much code in practice, and the simplification will make it easier to apply performance improvements down the road.

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.

2 participants