Skip to content

Commit

Permalink
Unify fatal log messages
Browse files Browse the repository at this point in the history
Longhorn 4210
Longhorn 3198

Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit authored and innobead committed Nov 16, 2022
1 parent e263e72 commit 36e8461
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions app/cmd/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ProcessCreateCmd() cli.Command {
},
Action: func(c *cli.Context) {
if err := createProcess(c); err != nil {
logrus.Fatalf("Error running process create command: %v.", err)
logrus.WithError(err).Fatal("Error running process create command")
}
},
}
Expand Down Expand Up @@ -75,7 +75,7 @@ func ProcessDeleteCmd() cli.Command {
},
Action: func(c *cli.Context) {
if err := deleteProcess(c); err != nil {
logrus.Fatalf("Error running process delete command: %v.", err)
logrus.WithError(err).Fatal("Error running process delete command")
}
},
}
Expand Down Expand Up @@ -105,7 +105,7 @@ func ProcessGetCmd() cli.Command {
},
Action: func(c *cli.Context) {
if err := getProcess(c); err != nil {
logrus.Fatalf("Error running process get command: %v.", err)
logrus.WithError(err).Fatal("Error running process get command")
}
},
}
Expand All @@ -131,7 +131,7 @@ func ProcessListCmd() cli.Command {
ShortName: "ls",
Action: func(c *cli.Context) {
if err := listProcess(c); err != nil {
logrus.Fatalf("Error running engine stop command: %v.", err)
logrus.WithError(err).Fatal("Error running engine stop command")
}
},
}
Expand Down Expand Up @@ -176,7 +176,7 @@ func ProcessReplaceCmd() cli.Command {
},
Action: func(c *cli.Context) {
if err := replaceProcess(c); err != nil {
logrus.Fatalf("Error running engine replace command: %v.", err)
logrus.WithError(err).Fatal("Error running engine replace command")
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func StartCmd() cli.Command {
},
Action: func(c *cli.Context) {
if err := start(c); err != nil {
logrus.Fatalf("Failed to run start command: %v.", err)
logrus.WithError(err).Fatal("Failed to run start command")
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion app/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func VersionCmd() cli.Command {
},
Action: func(c *cli.Context) {
if err := version(c); err != nil {
logrus.Fatalln("Error running info command:", err)
logrus.WithError(err).Fatal("Error running info command")
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ func main() {
cmd.VersionCmd(),
}
if err := a.Run(os.Args); err != nil {
logrus.Fatal("Error when executing command: ", err)
logrus.WithError(err).Fatal("Error when executing command")
}
}

0 comments on commit 36e8461

Please sign in to comment.