some details 💅

This commit is contained in:
Liang Ding 2015-01-13 13:54:19 +08:00
parent 93090f93c4
commit 0edec10397
2 changed files with 8 additions and 10 deletions

View File

@ -131,7 +131,12 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe
os.Exit(-1) os.Exit(-1)
} }
// Logging Level
log.SetLevel(Wide.LogLevel) log.SetLevel(Wide.LogLevel)
if "" != confLogLevel {
Wide.LogLevel = confLogLevel
log.SetLevel(confLogLevel)
}
logger.Debug("Conf: \n" + string(bytes)) logger.Debug("Conf: \n" + string(bytes))
@ -163,18 +168,14 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe
// Server // Server
Wide.Server = strings.Replace(Wide.Server, "{IP}", Wide.IP, 1) Wide.Server = strings.Replace(Wide.Server, "{IP}", Wide.IP, 1)
Wide.Server = strings.Replace(Wide.Server, "{Port}", Wide.Port, 1)
if "" != confServer { if "" != confServer {
Wide.Server = confServer Wide.Server = confServer
} }
// Logging Level
if "" != confLogLevel {
Wide.LogLevel = confLogLevel
log.SetLevel(confLogLevel)
}
// Static Server // Static Server
Wide.StaticServer = strings.Replace(Wide.StaticServer, "{IP}", Wide.IP, 1) Wide.StaticServer = strings.Replace(Wide.StaticServer, "{IP}", Wide.IP, 1)
Wide.StaticServer = strings.Replace(Wide.StaticServer, "{Port}", Wide.Port, 1)
if "" != confStaticServer { if "" != confStaticServer {
Wide.StaticServer = confStaticServer Wide.StaticServer = confStaticServer
} }
@ -192,9 +193,6 @@ func initWide(confPath, confIP, confPort, confServer, confLogLevel, confStaticSe
if "" != confChannel { if "" != confChannel {
Wide.Channel = 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). // FixedTimeCheckEnv checks Wide runtime enviorment periodically (7 minutes).

View File

@ -74,7 +74,7 @@ func load(localeStr string) {
Locales[localeStr] = l 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{} { func Get(locale, key string) interface{} {
return Locales[locale].Langs[key] return Locales[locale].Langs[key]
} }