From 3a7b7e453683a23424f361f31eb089f58215b911 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 21 Mar 2018 00:16:19 +0900 Subject: [PATCH] ing --- logging.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logging.go b/logging.go index f6e6dc1..b67c184 100644 --- a/logging.go +++ b/logging.go @@ -2,6 +2,7 @@ package logging import ( "flag" + "fmt" "log" "git.loafle.net/commons_go/config" @@ -14,7 +15,7 @@ var ( ) func init() { - configPath = flag.String("logger-config-path", "./logging.json", "The path of logger config file") + configPath = flag.String("log-config-path", "./logging.json", "The path of logger config file") flag.Parse() } @@ -23,6 +24,8 @@ var logger *zap.Logger func Logger() *zap.Logger { if nil == logger { initializeLogger() + + logger.Info(fmt.Sprintf("Logger has been initialized. config[%s]", *configPath)) } return logger } @@ -38,6 +41,7 @@ func initializeLogger() { if logger, err = zap.NewDevelopment(); nil != err { log.Panicf("Building of logger config[Development] has been failed [%v]", err) } + logger.Info("Logger has been initialized as development mode") return }