Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
c-wind committed Apr 11, 2018
1 parent f098b7f commit 3f54f53
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions log/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,71 +178,71 @@ func (l *Logger) write(t Level, format string, argv ...interface{}) {
//Info .
func (l *Logger) Info(v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogInfo, fmt.Sprint(v...))
}

//Infof .
func (l *Logger) Infof(format string, v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogInfo, format, v...)
}

//Debug .
func (l *Logger) Debug(v ...interface{}) {
if l == nil {
return nil
if l != nil {
return
}
l.write(LogDebug, fmt.Sprint(v...))
}

//Debugf .
func (l *Logger) Debugf(format string, v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogDebug, format, v...)
}

//Warning .
func (l *Logger) Warning(v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogWarning, fmt.Sprint(v...))
}

//Warningf .
func (l *Logger) Warningf(format string, v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogWarning, format, v...)
}

//Error .
func (l *Logger) Error(v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogError, fmt.Sprint(v...))
}

//Errorf .
func (l *Logger) Errorf(format string, v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogError, format, v...)
}

//Fatal .
func (l *Logger) Fatal(v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogFatal, fmt.Sprint(v...))
os.Exit(-1)
Expand All @@ -251,7 +251,7 @@ func (l *Logger) Fatal(v ...interface{}) {
//Fatalf .
func (l *Logger) Fatalf(format string, v ...interface{}) {
if l == nil {
return nil
return
}
l.write(LogFatal, format, v...)
os.Exit(-1)
Expand Down

0 comments on commit 3f54f53

Please sign in to comment.