-
Notifications
You must be signed in to change notification settings - Fork 5
Unify the logger conventions in drunc #729
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: develop
Are you sure you want to change the base?
Conversation
2f12788 to
5db142d
Compare
Specific logger to reviewThe current set up as is will basically have the same log outputs as what is in develop (except |
PawelPlesniak
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.
Some corrections to do
|
Comments have been addressed, but after chatting offline it results in two commits which I want your review on.
Note that both issues would be solved when we eventually move away from piping outputs from terminal to using actual file handlers |
Description
This pull request aims to unify the consistency of the loggers within drunc.
This is taking advantage of the inheritance, handlers, and the other nice features introduced in daqpytools.
See issue #691
Logger definitions and conventions
drunc.[parent], (also known as the '[parent]' logger, dropping the drunc prefix) will be responsible for having all the relevant handlers. By default, they will contain rich loggers__init__.pyfile of the utils module, as utils is used in several places. It is initialised with the rich handlerlog_emmuhamm_SSH_SHELL_process_manager.txtis that it saves all outputs the drunc unified shell in here. This PR changes it so that this file only saves anything within the 'process_manager' log handler, significantly reducing the amount of lines in that fileType of change
Testing checklist
dbt-build --unittest)pytest -s minimal_system_quick_test.py)daqsystemtest_integtest_bundle.sh)python -m pytest)pre-commit run --all-files)Testing instructions for the reviewer
Tested on NFD_DEV_251204_A9.
check out the drunc repository on this branch
Make a new folder somewhere, eg test_run_changes and cd into it
Repeat the shell commands as above
Compare differences between the log files in the two folders. there will be differences, but they should follow as what is described above
It might be useful to strip the date and time in the log files to better compare the two files. The script below can help
Run the below script to remove dates and times
``` #!/bin/bashlogfile="$1"
outfile="$(dirname "$logfile")/uni_$(basename "$logfile")"
sed -E 's/[[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} UTC]/[XXXX/XX/XX XX:XX:XX UTC]/g' "$logfile" > "$outfile"