-
Notifications
You must be signed in to change notification settings - Fork 2
Update to user logger #250
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?
Conversation
utility/check_ant.py
Outdated
| # Verify that all the config data has been added from RTS | ||
| print("\nBeginning a quick check of antenna %s" % ant.name) | ||
| print("\nAP version: %s" % ant.sensor.ap_api_version.get_value()) | ||
| user_logger.info("\nBeginning a quick check of antenna %s" % ant.name) |
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.
You do not need the end of line marker "\n" in the log message
utility/check_ant.py
Outdated
| user_logger.info("X-band serial number: %s" % ant.sensor.rsc_rxx_serial_number.get_value()) | ||
|
|
||
| print("\nChecking Receiver") | ||
| user_logger.info("\nChecking Receiver") |
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.
You do not need the end of line marker "\n" in the log message
utility/check_ant.py
Outdated
| check_receivers() | ||
|
|
||
| print("\nChecking Digitisers") | ||
| user_logger.info("\nChecking Digitisers") |
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.
You do not need the end of line marker "\n" in the log message
utility/check_ant.py
Outdated
| user_logger.info(":) AP Servo OK") | ||
|
|
||
| print("\nChecking brakes") | ||
| user_logger.info("\nChecking brakes") |
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.
You do not need the end of line marker "\n" in the log message
utility/check_ant.py
Outdated
| user_logger.info(":) Brakes released") | ||
|
|
||
| print("\nChecking doors") | ||
| user_logger.info("\nChecking doors") |
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.
You do not need the end of line marker "\n" in the log message
utility/check_ant.py
Outdated
|
|
||
| if any_errors: | ||
| print('\n') | ||
| user_logger.info('\n') |
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 is not needed in the log file
| user_logger.info(kat.controlled_objects) | ||
| user_logger.info(kat.ants.clients) | ||
| user_logger.info(opts) | ||
| user_logger.info("_______________________") |
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.
The objects should be formatted into strings to prevent unexpected surprises
utility/global_sync.py
Outdated
| print(ant.req.dig_capture_list()) | ||
| print('\n') | ||
| print("Script complete") | ||
| user_logger.info('\n') |
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 is not needed in the log
utility/lubricate_vacuum_pump.py
Outdated
| print opts | ||
| print "_______________________" | ||
| user_logger.info("_______________________") | ||
| user_logger.info(opt) |
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.
The objects should be formatted into strings to prevent unexpected surprises
|
Changes made as per request from @spassmoor |
|
Any other comments/concerns? |
|
|
||
| indexer_angle = ant.sensor.ap_indexer_position_raw.get_value() | ||
| print("receiver indexer value is %d." % indexer_angle) | ||
| user_logger.info("receiver indexer value is %d." % indexer_angle) |
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.
One of the advantages of logging is that string formatting is more compact. You can just write:
user_logger.info("receiver indexer value is %d.", indexer_angle)This is especially useful when multiple items are formatted, but a good habit nonetheless.
|
Revisiting the past? :-) My only comment still stands... I would change the formatting to use the logger friendly style. There is also a |
Have changed all the print statements to user_logger at the requisite levels in the utilities folder.
@ludwigschwardt
@spassmoor
@rubyvanrooyen
@kbmontshiwa