-
Notifications
You must be signed in to change notification settings - Fork 122
Add dynamic logging for full_system & thunderscope #3539
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: master
Are you sure you want to change the base?
Add dynamic logging for full_system & thunderscope #3539
Conversation
|
A few things I'm not sure about, firstly, I know we define some custom logging levels that have special behavior like CSV, VISUALIZE, and PLOTJUGGLER. These aren't currently being affected by the minimum log level option, not sure if we want to keep it as such. Also you'll probably notice the parsing of the log_levels argument in the main function of |
76dc9d9 to
ccc0b4d
Compare
ccc0b4d to
0aa7030
Compare
StarrryNight
left a comment
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.
Not sure about the custom logging options too, but it looks good for me overall!
| { | ||
| std::cout << "error: --log_level " << args.log_level | ||
| << " is not a valid option." << std::endl; | ||
| return 2; |
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.
I agree that the argument parsing should be in a separate helper function as it will make the main function less congested.
508d471 to
6626987
Compare
Description
Adds
--log_levelcli arg to full_system that controls the minimum log level from DEBUG, INFO, WARNING, FATAL. If--log_level=WARNINGis specified, only WARNING and FATAL messages are logged.Also adds a
--log_levelarg to thunderscope which just passes the value specified to full_system when starting.Testing Done
Added the following code to the unix_full_system_main.cpp main function:
And ran:
./tbots.py run thunderscope_main --log_level=DEBUG./tbots.py run thunderscope_main --log_level=INFO./tbots.py run thunderscope_main --log_level=WARNING./tbots.py run thunderscope_main --log_level=FATAL./tbots.py run full_system --log_level=DEBUG./tbots.py run full_system --log_level=INFO./tbots.py run full_system --log_level=WARNING./tbots.py run full_system --log_level=FATALAnd saw that the messages from the expected log levels were printed.
Also tried with adding some log statements to
ball_filter.cppwhich runs every update, and saw that the behavior is still correct.Resolved Issues
resolves #1840
Length Justification and Key Files to Review
N/A
Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.hfile) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.TODO(or similar) statements should either be completed or associated with a github issue