Open ericphanson opened 3 months ago
Oh yeah, I remember @topolarity on that branch restricted what a bunch of things could contain.
In this case i guess group
was restricted to Symbol
which seems unfortunate, not just for this use case, but also for like i wanted to use a collection of tags as a group.
See also https://github.com/JuliaLang/julia/pull/40820 for when I had code (in this repo?) that assumed Symbol
Ah, interesting (sorry, missed this issue originally). My logging preferences have evolved somewhat recently where I'm actually likely to move a lot of my packages away from teh verbosity logging macros. I've become more interested in a core logging approach where each log is associated w/ a "subject", which I believe is what the group
argument is for anyway. What I'd really like though, is a very easy/convenient way to not only globally set the log level, but also the subject (or subjects) I'm interested in.
For example, the verbosity logs don't really help when I turn on debug logging in HTTP/CSV, because I also get debug logs in the CodecZlib package, which I don't care about when I'm just trying to debug an HTTP/CSV issue. I'd rather be able to say that I'm specifically interested in a certain level + subject and only see logs tagged w/ that level/subject.
I think I owe an apology to @fredrikekre because I think he tried to dissuade me from the verbosity approach initially. Haha. Sorry it took me longer to come around and figure things out on my own.
But with regards to the overall issue here, I guess we could generate special symbols that would be used here, like VERBOSITY_1
, VERBOSITY_2
, etc. and then have to check for those? It introduces a slight change for symbol collision (since anyone could potentially set the verbosity symbol themselves), but seems relatively safe.
Alright, I think trying to support the verbosity macros is going to be too tedious, because we get into the tricky business of having to parse the VERBOSITY_N symbols to do the integer comparison on verbosity level. As I believe I'm the only user of these, I'm going to deprecate them.
In the same PR, I'm exporting withlevel
(#81 ) and adding a convenience group
keyword arg to withlevel
that allows early filtering on the group
arg of log messages. I think this will fit my ideal as mentioned above. I can go through my packages that use the verbosity logs and replace them with appropriate _group
annotations which will pretty much get me all the way towards my ideal.
PR: https://github.com/JuliaLogging/LoggingExtras.jl/pull/94
where the stacktrace points to https://github.com/apache/arrow-julia/blob/f1a91bfcbdca5532002d75c127db858d49133cec/src/table.jl#L446
on
jb/gb/static-call-graph/f862b4f746
. I can reproduce with juston that branch. Might be nothing to do here, since I think that branch has made some changes that might not be merged in exactly that form.