-
Notifications
You must be signed in to change notification settings - Fork 243
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
Unify all logfile handling into utils_logfile #3782
Conversation
The "genio"/"log_file" is quite dangerous and requires using private members of "genio" module. Unfortunatelly "Avocado-vt" heavily depends on this so let's just fix style issues and add docstrings explaining the issues. Signed-off-by: Lukáš Doktor <[email protected]>
Most importantly, for better decoupling with aexpect we provide sessions with close hooks that should have the same effect of closing the open log file descriptors but in a more decoupled fashion. The logging functionality in utils_misc has been fully deprecated for the sake of the same functionality in a fully devoted module. Signed-off-by: Plamen Dimitrov <[email protected]>
58b7035
to
f1c09e7
Compare
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.
LGTM, seems to cover all utils_misc.*log
occurrences while keeping the deprecated interface for tp-*
and other consumers. As far as I understand this PR needs to be merged before avocado-framework/aexpect#124 in order for avocado-vt to work with the aexpect after the avocado-framework/aexpect#124 is merged, right (it will still work with the released aexpect, though)
Exactly, this is also my understanding. |
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.
Hi @pevogam , thank you for bringing up this proposal! it indeed improves the code quality for both VT and aexpect and prevents some potential issues. However I have some comments regarding the following details.
Since we are handling the complete log file setup and cleanup on the Avocado VT side we can use the more powerful close hook approach to provide the log file path via currying and a function wrapper. Signed-off-by: Plamen Dimitrov <[email protected]>
ff2689b
to
68c0b39
Compare
I pushed a small fix for some cases of |
784f3e5
to
237a8c8
Compare
The environment setup module could close all log files once all sessions are closed but we have to keep backwards compatibility with other uses cases of closing just a single or few log files. Signed-off-by: Plamen Dimitrov <[email protected]>
237a8c8
to
04a89c0
Compare
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.
LGTM
@ldoktor Does your LGTM ack remain valid? Or would you like to suggest other changes? |
Yep, looks good. I mean using |
I think using @luckyh I have integration tested the recent changes fully (with the corresponding aexpect side adapted too) and everything checks out. As this pull request has two approvals we can either merge or ask another VT maintainer to review this pull request too if you like. |
ok, let's merge this, thanks to all! |
Most importantly, for better decoupling with aexpect we provide sessions with close hooks that should have the same effect of closing the open log file descriptors but in a more decoupled fashion.
The logging functionality in utils_misc has been fully deprecated for the sake of the same functionality in a fully devoted module.