From 1d48dfc68bea2139b62669dca383fb010e3afd5c Mon Sep 17 00:00:00 2001 From: jackdaw Date: Wed, 9 Nov 2016 11:58:55 +0900 Subject: [PATCH] set stacklevel --- log.go | 81 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/log.go b/log.go index e8724c9..2e7fb3f 100644 --- a/log.go +++ b/log.go @@ -1,77 +1,77 @@ package log import ( - "fmt" - "github.com/cihub/seelog" + "fmt" + "github.com/cihub/seelog" ) + //var logger seelog.LoggerInterface func LoadLogConfig(path string) error { - //pwd, _ := os.Getwd() + //pwd, _ := os.Getwd() - //path := pwd+"/src/loafle.com/overflow/collector/log/seelogconfig.xml" - //var err error + //path := pwd+"/src/loafle.com/overflow/collector/log/seelogconfig.xml" + //var err error - logger, err := seelog.LoggerFromConfigAsFile(path) + logger, err := seelog.LoggerFromConfigAsFile(path) - if err != nil { - fmt.Println("Error : ", err) - return err - } + if err != nil { + fmt.Println("Error : ", err) + return err + } - seelog.ReplaceLogger(logger) - - return err + seelog.ReplaceLogger(logger) + seelog.Current.SetAdditionalStackDepth(1) + return err } -func Debugf(format string, params ...interface{}) { - seelog.Debugf(format, params) +func Debugf(format string, params ...interface{}) { + seelog.Debugf(format, params) } -func Tracef(format string, params ...interface{}) { - seelog.Tracef(format, params) +func Tracef(format string, params ...interface{}) { + seelog.Tracef(format, params) } -func Warnf(format string, params ...interface{}) { - seelog.Warnf(format, params) +func Warnf(format string, params ...interface{}) { + seelog.Warnf(format, params) } -func Infof(format string, params ...interface{}) { - seelog.Infof(format, params) +func Infof(format string, params ...interface{}) { + seelog.Infof(format, params) } -func Errorf(format string, params ...interface{}) { - seelog.Errorf(format, params) +func Errorf(format string, params ...interface{}) { + seelog.Errorf(format, params) } -func Criticalf(format string, params ...interface{}) { - seelog.Criticalf(format, params) +func Criticalf(format string, params ...interface{}) { + seelog.Criticalf(format, params) } - //func Fatalf(format string, params ...interface{}) { // seelog.Criticalf(format, params) // os.Exit(1) //} -func Debug(v ...interface{}) { - seelog.Debug(v) +func Debug(v ...interface{}) { + seelog.Debug(v) } -func Trace(v ...interface{}) { - seelog.Trace(v) +func Trace(v ...interface{}) { + seelog.Trace(v) } -func Warn(v ...interface{}) { - seelog.Warn(v) +func Warn(v ...interface{}) { + seelog.Warn(v) } -func Info(v ...interface{}) { - seelog.Info(v) +func Info(v ...interface{}) { + seelog.Info(v) } -func Error(v ...interface{}) { - seelog.Error(v) +func Error(v ...interface{}) { + seelog.Error(v) } -func Critical(v ...interface{}) { - seelog.Critical(v) +func Critical(v ...interface{}) { + seelog.Critical(v) } //func Fatal(v ...interface{}) { @@ -79,7 +79,6 @@ func Critical(v ...interface{}) { // os.Exit(1) //} -func Flush() { - seelog.Flush() +func Flush() { + seelog.Flush() } -