From 0edec10397dab0fe8a32dcf55b77f0f14530031d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 13 Jan 2015 13:54:19 +0800 Subject: [PATCH] some details :nail_care: --- conf/wide.go | 16 +++++++--------- i18n/locales.go | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/conf/wide.go b/conf/wide.go index 4e4808e..02442b6 100644 --- a/conf/wide.go +++ b/conf/wide.go @@ -131,7 +131,12 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe os.Exit(-1) } + // Logging Level log.SetLevel(Wide.LogLevel) + if "" != confLogLevel { + Wide.LogLevel = confLogLevel + log.SetLevel(confLogLevel) + } logger.Debug("Conf: \n" + string(bytes)) @@ -163,18 +168,14 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe // Server Wide.Server = strings.Replace(Wide.Server, "{IP}", Wide.IP, 1) + Wide.Server = strings.Replace(Wide.Server, "{Port}", Wide.Port, 1) if "" != confServer { Wide.Server = confServer } - // Logging Level - if "" != confLogLevel { - Wide.LogLevel = confLogLevel - log.SetLevel(confLogLevel) - } - // Static Server Wide.StaticServer = strings.Replace(Wide.StaticServer, "{IP}", Wide.IP, 1) + Wide.StaticServer = strings.Replace(Wide.StaticServer, "{Port}", Wide.Port, 1) if "" != confStaticServer { Wide.StaticServer = confStaticServer } @@ -192,9 +193,6 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe if "" != confChannel { Wide.Channel = confChannel } - - Wide.Server = strings.Replace(Wide.Server, "{Port}", Wide.Port, 1) - Wide.StaticServer = strings.Replace(Wide.StaticServer, "{Port}", Wide.Port, 1) } // FixedTimeCheckEnv checks Wide runtime enviorment periodically (7 minutes). diff --git a/i18n/locales.go b/i18n/locales.go index e3aeef0..9dfdade 100644 --- a/i18n/locales.go +++ b/i18n/locales.go @@ -74,7 +74,7 @@ func load(localeStr string) { Locales[localeStr] = l } -// Get gets message with the specified locale and key. +// Get gets a message with the specified locale and key. func Get(locale, key string) interface{} { return Locales[locale].Langs[key] }