From 1203d4f164418587f64ca0851bc9500498f35274 Mon Sep 17 00:00:00 2001 From: Farhan Khan Date: Sun, 17 Jan 2021 04:17:15 +0000 Subject: [PATCH] added log.go --- log.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 log.go 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) +}