log: show caller's info in verbose mode

This commit is contained in:
nadoo committed 2019-10-20 17:52:25 +08:00
1 parent ef8cdfa703
commit 486c455236
6 files changed
+23 -4

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
package main
import (
"fmt"
stdlog "log"
"os"
"os/signal"
@@ -38,7 +39,7 @@ func main() {
// setup a log func
log.F = func(f string, v ...interface{}) {
if conf.Verbose {
stdlog.Printf(f, v...)
stdlog.Output(2, fmt.Sprintf(f, v...))
}
}