replace custom debug handling with LoggingExtras#355
Conversation
|
the standard Julia logging doesn't quite support the same thing as this, as here we have |
|
Yes, that was my plan eventually (switch to the debugv macro in LoggingExtras). |
|
Hmm I guess I mistook Julia's "Programmatically defined levels" feature: https://github.com/JuliaLang/julia/blob/v1.8.2/base/logging.jl#L183 It seems like this ability to log as non-standard levels and filter loggers for non-standard levels should be supported in Julia's Base. I'll read @quinnj's LoggingExtras. Thanks. |
Codecov Report
@@ Coverage Diff @@
## main #355 +/- ##
==========================================
+ Coverage 87.39% 87.67% +0.27%
==========================================
Files 25 25
Lines 3126 3115 -11
==========================================
- Hits 2732 2731 -1
+ Misses 394 384 -10
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
quinnj
left a comment
There was a problem hiding this comment.
This LGTM for now. Thanks for the cleanup @baumgold!
The other step I'd like to do here is that at the top level of Arrow.Stream/Arrow.Table/Arrow.write/Arrow.append (i.e. main user entrypoints), to add a keyword argument debug::Int=0 where the user could simply pass debug=2 and then we'd wrap the body of the methods in:
LoggingExtras.withlevel(Debug; verbosity=debug) do
# method body
endI feel like that's a super convenient way to quickly turn on/off the debug logs without having to import LoggingExtras yourself or get the withlevel syntax right.
We don't need to do that here if you'd rather not; I can add it later.
|
I'm not a big fan of integrating log-level en/disabling logic within the Arrow APIs as it should really be an orthogonal concept. I understand that your proposal make enabling debug logging convenient, but it also seems to add some extra complexity to an already complex codebase. Maybe your proposal is actually very clean and elegant but I don't see how yet. I'll keep thinking about it but for now I think we should add that change in a separate branch/PR. |
LoggingExtras.jl already handles this functionality.