update: make things work with the new package system
This commit is contained in:
23
log/log.go
Normal file
23
log/log.go
Normal file
@ -0,0 +1,23 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Log(p string, f string, args ...interface{}) {
|
||||
now := time.Now()
|
||||
nstr := now.Format("[02/01/06 15:04:05]")
|
||||
|
||||
fmt.Printf("%s -%s- ", nstr, p)
|
||||
fmt.Printf(f, args...)
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
func Info(f string, args ...interface{}) {
|
||||
Log("INFO", f, args...)
|
||||
}
|
||||
|
||||
func Error(f string, args ...interface{}) {
|
||||
Log("ERROR", f, args...)
|
||||
}
|
Reference in New Issue
Block a user