Skip to content
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

Log result of the command before returning from main #1302

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

YJDoc2
Copy link
Collaborator

@YJDoc2 YJDoc2 commented Oct 25, 2022

This will log the error if there was any when executing the command. This will help in trying to figure out what was the issue from the logs, as right now, we do not get any info about it from the logs. This was particularly irritating when trying to fix the containerd test, as it would just report runtime exited with 1, and even the logs would not show anything.

Signed-off-by: Yashodhan Joshi yjdoc2@gmail.com

@YJDoc2 YJDoc2 requested a review from utam0k October 25, 2022 05:56
@codecov-commenter
Copy link

Codecov Report

Merging #1302 (08b47a9) into main (c794664) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1302      +/-   ##
==========================================
- Coverage   68.97%   68.96%   -0.01%     
==========================================
  Files         119      119              
  Lines       12557    12560       +3     
==========================================
+ Hits         8661     8662       +1     
- Misses       3896     3898       +2     

};

if let Err(ref e) = output {
log::error!("error in executing command : {:?}", e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log::error!("error in executing command : {:?}", e);
log::error!("error in executing command: {:?}", e);

@@ -97,7 +97,7 @@ fn main() -> Result<()> {
let root_path = determine_root_path(opts.global.root)?;
let systemd_cgroup = opts.global.systemd_cgroup;

match opts.subcmd {
let output = match opts.subcmd {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the name of the variable?

Suggested change
let output = match opts.subcmd {
let cmd_result = match opts.subcmd {

Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
@YJDoc2
Copy link
Collaborator Author

YJDoc2 commented Oct 25, 2022

@utam0k PTAL, have made both of the suggested changes 👍

Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@utam0k utam0k merged commit 1c32af7 into youki-dev:main Oct 25, 2022
@YJDoc2 YJDoc2 deleted the log_final_result branch November 8, 2022 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants