Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stephenswat
Copy link
Member

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.

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.
@stephenswat stephenswat added feature New feature or request examples Changes to the examples labels Feb 27, 2025
Copy link

Copy link
Member

@krasznaa krasznaa left a 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.

Comment on lines +75 to +87
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";
}
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

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!

@krasznaa
Copy link
Member

krasznaa commented May 1, 2025

What about this one? Anything preventing us from finishing this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Changes to the examples feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants