added log.go

This commit is contained in:
farhan 2021-01-17 04:17:15 +00:00
parent 9d2601e6c9
commit 1203d4f164

22
log.go Normal file
View 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)
}