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

Deprecate verbosity macros (not compatible w/ juliac-compiled programs) #94

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Oct 21, 2024

Add convenience group keyword to withlevel to do early filtering on groups

Export withlevel

Add convenience group keyword to withlevel to do early filtering on groups

Export withlevel
src/verbosity.jl Outdated Show resolved Hide resolved
Comment on lines +92 to +95
For convenience, a `group` keyword argument can be passed which also
filters logging messages on the "group". By default, the group is the
file name of the log macro call site, but can be overridden by passing
the `_group` keyword argument to the logging macros.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not conviced thsi is better than just using

with_logger(EarlyFilteredLogger(x->x.group==:Foo) do
...
end

Maybe we should instead be adding a

filter_group_logger(group) = EarlyFilteredLogger(x->x.group==group)

if it really is too long

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really the convenience of having it bundled with the withlevel function. It's so onerous remembering the incantation to get the logger, set it to the new one, and then on top remember the LoggingExtras machinery to early filter. Bundling that all up into withlevel as the "one thing" I need to remember as a package dev is what makes this work really well.

Co-authored-by: Frames White <[email protected]>
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