From a2fb265563a3a6eb80efc5720bb0c6f3fec6f397 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 19 May 2014 17:02:16 +0200 Subject: [PATCH] Added a fatal method --- ethutil/config.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ethutil/config.go b/ethutil/config.go index 296b72d9e..fd590fbdb 100644 --- a/ethutil/config.go +++ b/ethutil/config.go @@ -130,7 +130,6 @@ func (log *Logger) Infoln(v ...interface{}) { return } - //fmt.Println(len(log.logSys)) for _, logger := range log.logSys { logger.Println(v...) } @@ -145,3 +144,15 @@ func (log *Logger) Infof(format string, v ...interface{}) { logger.Printf(format, v...) } } + +func (log *Logger) Fatal(v ...interface{}) { + if log.logLevel > LogLevelInfo { + return + } + + for _, logger := range log.logSys { + logger.Println(v...) + } + + os.Exit(1) +}