added log.go
This commit is contained in:
parent
9d2601e6c9
commit
1203d4f164
22
log.go
Normal file
22
log.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
logInfo *log.Logger
|
||||||
|
logWarn *log.Logger
|
||||||
|
logErr *log.Logger
|
||||||
|
logDebug *log.Logger
|
||||||
|
logFatal *log.Logger
|
||||||
|
)
|
||||||
|
|
||||||
|
func logInit() {
|
||||||
|
logInfo = log.New(os.Stderr, "INFO: ", log.Lmsgprefix|log.Ldate|log.Ltime)
|
||||||
|
logWarn = log.New(os.Stderr, "WARN: ", log.Lmsgprefix|log.Ldate|log.Ltime)
|
||||||
|
logErr = log.New(os.Stderr, "ERR: ", log.Lmsgprefix|log.Ldate|log.Ltime)
|
||||||
|
logFatal = log.New(os.Stderr, "FATAL: ", log.Lmsgprefix|log.Ldate|log.Ltime)
|
||||||
|
logDebug = log.New(os.Stderr, "DEBUG: ", log.Lmsgprefix|log.Ldate|log.Ltime)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user