-
Notifications
You must be signed in to change notification settings - Fork 53
Add CLI options to control logging verbosity #897
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
base: main
Are you sure you want to change the base?
Conversation
This commit adds the `-v` and `-q` flag that control verbosity, respectively making the code more verbose or more quiet. Also adds these options to the throughput examples.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course we should get such options for the executables. But I'd prefer the command line interface to be a bit simpler.
if (lvl == traccc::Logging::Level::VERBOSE) { | ||
verbosity_string = "Verbose"; | ||
} else if (lvl == traccc::Logging::Level::DEBUG) { | ||
verbosity_string = "Debug"; | ||
} else if (lvl == traccc::Logging::Level::INFO) { | ||
verbosity_string = "Info"; | ||
} else if (lvl == traccc::Logging::Level::WARNING) { | ||
verbosity_string = "Warning"; | ||
} else if (lvl == traccc::Logging::Level::ERROR) { | ||
verbosity_string = "Error"; | ||
} else if (lvl == traccc::Logging::Level::FATAL) { | ||
verbosity_string = "Fatal"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This would seem like a perfect place for
switch
--case
; - Why change the capitalization on the printout wrt. the enum names? I would prefer to keep the same capitalized names for the printout at well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I personally prefer to avoid switch statements whenever convenient because they more confusing and error prone than if-else statements, but I don't feel tremendously strongly about it.
Neither do I feel strongly about the capitalization! We can keep it all-caps in line with the enum values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we could just use the following heere:
https://github.com/acts-project/acts/blob/main/Core/include/Acts/Utilities/Logger.hpp#L168
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's a really nice idea!
What about this one? Anything preventing us from finishing this one? |
This commit adds the
-v
and-q
flag that control verbosity, respectively making the code more verbose or more quiet. Also adds these options to the throughput examples.