diff --git a/log.go b/log.go new file mode 100644 index 0000000..ac56351 --- /dev/null +++ b/log.go @@ -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) +}