Skip to content
Snippets Groups Projects
Commit e6e6333e authored by patelpayal's avatar patelpayal Committed by Liz Rice
Browse files

add glog flush to write the output to a file (#329)

* add glog flush to write the output to a file

* add glog flush before exit on error and fix code comment
parent 5e6cdfdb
Branches
Tags v0.0.30
No related merge requests found
......@@ -74,8 +74,12 @@ func Execute() {
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
// flush before exit non-zero
glog.Flush()
os.Exit(-1)
}
// flush before exit
glog.Flush()
}
func init() {
......
......@@ -35,6 +35,8 @@ func init() {
func exitWithError(err error) {
fmt.Fprintf(os.Stderr, "\n%v\n", err)
// flush before exit non-zero
glog.Flush()
os.Exit(1)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment