fix: panic on flag parsing error (#238)

This is a follow-up for #235.

We setup the default logger only after the flags are parsed successfully.
That's because we init the logger according to the --log-level flag value.
This commit is contained in:
KUOKA Yusuke 2018-08-27 22:58:25 +09:00 committed by GitHub
parent fcbd6aff29
commit faaf172615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -386,7 +386,7 @@ func main() {
err := app.Run(os.Args)
if err != nil {
logger.Errorf("%v", err)
fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(3)
}
}