glider/common/log/log.go

26 lines
436 B
Go
Raw Normal View History

package log
import (
stdlog "log"
)
func init() {
stdlog.SetFlags(stdlog.LstdFlags | stdlog.Lshortfile)
}
// Func defines a simple log function
type Func func(f string, v ...interface{})
2018-06-26 17:00:13 +08:00
// F is the main log function
2018-06-26 20:43:47 +08:00
var F Func = func(string, ...interface{}) {}
2018-06-26 17:00:13 +08:00
// Fatal log and exit
func Fatal(v ...interface{}) {
2018-06-26 20:43:47 +08:00
stdlog.Fatal(v...)
}
2018-06-26 17:00:13 +08:00
// Fatalf log and exit
func Fatalf(f string, v ...interface{}) {
2018-06-26 20:43:47 +08:00
stdlog.Fatalf(f, v...)
}