|
|
|
@ -37,15 +37,17 @@ var debugStart time.Time
|
|
|
|
|
var debugVerbosity int
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
filename := time.Now().Format("01-02T15:04:05")
|
|
|
|
|
filename += ".log"
|
|
|
|
|
f, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
log.SetOutput(f)
|
|
|
|
|
debugVerbosity = getVerbosity()
|
|
|
|
|
debugStart = time.Now()
|
|
|
|
|
if debugVerbosity > 0 {
|
|
|
|
|
filename := time.Now().Format("01-02T15:04:05")
|
|
|
|
|
filename += ".log"
|
|
|
|
|
f, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
log.SetOutput(f)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime)) // turns off date and time so we can set manually
|
|
|
|
|
}
|
|
|
|
|