Skip to content

Commit

Permalink
call exit on fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed Apr 7, 2017
1 parent c9c6a6b commit 36041d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions grpclog/grpclog.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

package grpclog

import "os"

var logger = newLoggerV2()

// V reports whether verbosity level l is at least the requested verbose level.
Expand Down Expand Up @@ -88,16 +90,19 @@ func Errorln(args ...interface{}) {
// Fatal is equivalent to Info() followed by a call to os.Exit() with a non-zero exit code.
func Fatal(args ...interface{}) {
logger.Fatal(args...)
os.Exit(1)
}

// Fatalf is equivalent to Infof() followed by a call to os.Exit() with a non-zero exit code.
func Fatalf(format string, args ...interface{}) {
logger.Fatalf(format, args...)
os.Exit(1)
}

// Fatalln is equivalent to Infoln() followed by a call to os.Exit()) with a non-zero exit code.
func Fatalln(args ...interface{}) {
logger.Fatalln(args...)
os.Exit(1)
}

// Print prints to the logger. Arguments are handled in the manner of fmt.Print.
Expand Down

0 comments on commit 36041d3

Please sign in to comment.