Logger replaced with a variant that don't write date to stdout.
This commit is contained in:
parent
588be2c2bb
commit
d601ec607b
@ -37,7 +37,7 @@ func (l *Logger) Println(v ...interface{}) {
|
|||||||
fmt.Fprintln(l.file, nowStr, v)
|
fmt.Fprintln(l.file, nowStr, v)
|
||||||
|
|
||||||
if l.toStdout {
|
if l.toStdout {
|
||||||
fmt.Println(nowStr, v)
|
fmt.Println(v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ func (l *Logger) Printf(format string, v ...interface{}) {
|
|||||||
fmt.Fprintf(l.file, nowStr+" "+format, v...)
|
fmt.Fprintf(l.file, nowStr+" "+format, v...)
|
||||||
|
|
||||||
if l.toStdout {
|
if l.toStdout {
|
||||||
fmt.Printf(nowStr+" "+format, v...)
|
fmt.Printf(format, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ func (l *Logger) Fatalln(v ...interface{}) {
|
|||||||
fmt.Fprintln(l.file, nowStr, v)
|
fmt.Fprintln(l.file, nowStr, v)
|
||||||
|
|
||||||
if l.toStdout {
|
if l.toStdout {
|
||||||
fmt.Println(nowStr, v)
|
fmt.Println(v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
l.file.Close()
|
l.file.Close()
|
||||||
@ -87,7 +87,7 @@ func (l *Logger) Fatalf(format string, v ...interface{}) {
|
|||||||
fmt.Fprintf(l.file, nowStr+" "+format, v...)
|
fmt.Fprintf(l.file, nowStr+" "+format, v...)
|
||||||
|
|
||||||
if l.toStdout {
|
if l.toStdout {
|
||||||
fmt.Printf(nowStr+" "+format, v...)
|
fmt.Printf(format, v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
l.file.Close()
|
l.file.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user