summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-10 18:32:22 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-10 18:32:22 -0700
commite06e292be71ca699d90bafbd635118aa47c2d7a5 (patch)
tree3f8f7ce86a1618f625e71084041746745139ba0c /utils/config.go
parent41439eb801c6c8c0a55bcada3eeba3b4a561c663 (diff)
downloadchat-e06e292be71ca699d90bafbd635118aa47c2d7a5.tar.gz
chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.tar.bz2
chat-e06e292be71ca699d90bafbd635118aa47c2d7a5.zip
PLT-12 adding log viewer
Diffstat (limited to 'utils/config.go')
-rw-r--r--utils/config.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/utils/config.go b/utils/config.go
index c67e17e79..a1d282c29 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -11,9 +11,10 @@ import (
)
const (
- MODE_DEV = "dev"
- MODE_BETA = "beta"
- MODE_PROD = "prod"
+ MODE_DEV = "dev"
+ MODE_BETA = "beta"
+ MODE_PROD = "prod"
+ LOG_ROTATE_SIZE = 10000
)
type ServiceSettings struct {
@@ -180,10 +181,10 @@ func ConfigureCmdLineLog() {
ls.ConsoleEnable = true
ls.ConsoleLevel = "ERROR"
ls.FileEnable = false
- configureLog(ls)
+ configureLog(&ls)
}
-func configureLog(s LogSettings) {
+func configureLog(s *LogSettings) {
l4g.Close()
@@ -217,7 +218,7 @@ func configureLog(s LogSettings) {
flw := l4g.NewFileLogWriter(s.FileLocation, false)
flw.SetFormat(s.FileFormat)
flw.SetRotate(true)
- flw.SetRotateLines(100000)
+ flw.SetRotateLines(LOG_ROTATE_SIZE)
l4g.AddFilter("file", level, flw)
}
}
@@ -241,7 +242,7 @@ func LoadConfig(fileName string) {
panic("Error decoding config file=" + fileName + ", err=" + err.Error())
}
- configureLog(config.LogSettings)
+ configureLog(&config.LogSettings)
Cfg = &config
SanitizeOptions = getSanitizeOptions()