update
This commit is contained in:
parent
2292bbc976
commit
077ac8d73b
4
log.go
4
log.go
@ -22,7 +22,7 @@ func failError(err error, format string, a ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func logError(err error, lvl uint, format string, a ...interface{}) {
|
func logError(err error, lvl uint, format string, a ...interface{}) {
|
||||||
if err != nil && lvl >= cfgTracker.LOG.Level {
|
if err != nil && lvl >= 0 {
|
||||||
_, fn, line, _ := runtime.Caller(2)
|
_, fn, line, _ := runtime.Caller(2)
|
||||||
out := fmt.Sprintf(format, a...)
|
out := fmt.Sprintf(format, a...)
|
||||||
log.Printf("[%s:%d] %s : %s", filepath.Base(fn), line, out, err)
|
log.Printf("[%s:%d] %s : %s", filepath.Base(fn), line, out, err)
|
||||||
@ -30,7 +30,7 @@ func logError(err error, lvl uint, format string, a ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func logInfo(lvl uint, format string, a ...interface{}) {
|
func logInfo(lvl uint, format string, a ...interface{}) {
|
||||||
if lvl >= cfgTracker.LOG.Level {
|
if lvl >= 0 {
|
||||||
_, fn, line, _ := runtime.Caller(2)
|
_, fn, line, _ := runtime.Caller(2)
|
||||||
out := fmt.Sprintf(format, a...)
|
out := fmt.Sprintf(format, a...)
|
||||||
log.Printf("[%s:%d] %s", filepath.Base(fn), line, out)
|
log.Printf("[%s:%d] %s", filepath.Base(fn), line, out)
|
||||||
|
Loading…
Reference in New Issue
Block a user