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
RFC: Logging Updates #3102
Comments
I generally like the below but have a few comments.
Since this is so sparsely used, I'm wondering if we need it at all (i.e. if we need to print any information to the user in non-verbose mode). I'm sometimes using
I like this, although I think that
Requiring
|
We're defining what levels come with file name and line number so that could apply to INFO but I'm fine using DEBUG instead of INFO. But yeah, I agree that neither will probably get used much.
I agree with all of this. Let's get rid of verbose2 entirely. And yes, great discussion for next office hours.
Ah, good point about the semantic analyzer. I guess in the guidelines we can just specify that if you use |
Updated proposal:
|
How about
Does "exit via Otherwise I like it! |
+1 here, we don't need to explicitly recommend exiting via |
I prefer V1 mostly because VERBOSE is well... verbose. I was also thinking of changing WARNING to just WARN. V1 leaves the door open to have additional levels but it also implies there are multiple, which there won't be (in this proposal). I'm torn.
JC, what is the use case for logging errors that end in a clean exit? Or am I just getting hung up on the word "clean" - we should be calling |
Yes, I meant using e.g. |
@ajor and I were discussing offline and it seems like there are still some sticking points with One of the issues is that Additionally, I'm not a fan of |
Currently, we have 6 different log flavors (all with varying degrees of use and for varying purposes):
DEBUG
(used 1 time)INFO
(used 3 times - one of those times is wrong and another is in a unit test)WARNING
(used a lot)ERROR
(used a lot)FATAL
(used a lot)BUG
(used 17 times)At the moment, it seems like
FATAL
andBUG
are used interchangeably andERROR
is sometimes used like aWARNING
and other times likeFATAL
(callingexit
right after). There are also plenty of uses ofstd::cout
andstd::cerr
- sometimes nested insidebt_verbose
checks.UPDATED Proposal in a comment below.
So this is an RFC to re-work and codify these logging flavors. Here is the outdated proposal:
INFO
: log info to the user regardless of log level - like using stdoutV1
: log info to the user only if verbose logging is enabled (bt_verbose or -v)V2
: log info to the user only if very verbose logging is enabled (bt_verbose2 or -vv)WARNING
: log info that might affect bpftrace behavior or output but allows the run to continue - like using stderrERROR
: abort run and log info to indicate that the user did something invalid which caused bpftrace to exitBUG
: abort run and log info to indicate that there is an internal/unexpected issue (not caused by invalid user program code or CLI use)Note:
V1
andV2
will replace all instances like this:The text was updated successfully, but these errors were encountered: