This commit is contained in:
crusader 2017-09-13 12:24:16 +09:00
parent 3692aeb915
commit 805ddec62e

View File

@ -2,8 +2,6 @@ package logging
import ( import (
"encoding/json" "encoding/json"
"flag"
"log"
"git.loafle.net/commons_go/config" "git.loafle.net/commons_go/config"
@ -17,16 +15,11 @@ const loggerKey loggerKeyType = iota
var Logger *zap.Logger var Logger *zap.Logger
func init() { func init() {
configPath := flag.String("config", ".", "The path of config")
flag.Parse()
log.Printf("logging: config path1[%s]", *configPath)
conf := config.New() conf := config.New()
conf.SetConfigName("logging") conf.SetConfigName("logging")
conf.SetConfigType("json") conf.SetConfigType("json")
conf.AddConfigPath(*configPath) conf.AddConfigPath(".")
// conf.AddConfigPath("./config") conf.AddConfigPath("./config")
err := conf.ReadInConfig() err := conf.ReadInConfig()
if nil != err { if nil != err {
panic(err) panic(err)