24 lines
373 B
Go
24 lines
373 B
Go
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...)
|
|
}
|