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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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