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

change log.Fatal to log.Error to make subsequent os.Exit executable #189

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

Abirdcfly
Copy link
Contributor

We use log "github.com/sirupsen/logrus" for log package:

log "github.com/sirupsen/logrus"

And we use version 1.9 (show in go.mod)
github.com/sirupsen/logrus v1.9.0

we use os.Exit(-1) after line 88 log.Fatalln and line 96 log.Fatalf
From Fatalln doc:

Fatalln logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

So subsequent os.Exit(-1) will not executable.

Same with log.Fatalf.

So, here are 2 solutions:
option 1: just delete os.Exit(-1);
option 2: change log.Fatal to log.Error

I think option 2 is more appropriate.

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 8, 2022

Codecov Report

Merging #189 (21a702e) into main (88fc4e4) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #189   +/-   ##
=======================================
  Coverage   93.92%   93.92%           
=======================================
  Files          46       46           
  Lines        3655     3655           
=======================================
  Hits         3433     3433           
  Misses        155      155           
  Partials       67       67           

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Contributor

@haoel haoel left a comment

Choose a reason for hiding this comment

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

Thanks for this correction!

@haoel haoel merged commit 92c5345 into megaease:main Aug 8, 2022
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