summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
authorDerrick Anderson <derrick@andersonwebstudio.com>2018-04-17 09:21:33 -0400
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-04-17 09:21:33 -0400
commit885b8e51f3c0b0a4d98814b43917670c2193b3a4 (patch)
treee68563c27267d1d493e016f6846531bc033f698e /utils/config.go
parent997df03ac1455785b7a39e40edcd67b3b3e86f9e (diff)
parent3176e13b1f9b14192bef2337ff3fb9346f26ef66 (diff)
downloadchat-885b8e51f3c0b0a4d98814b43917670c2193b3a4.tar.gz
chat-885b8e51f3c0b0a4d98814b43917670c2193b3a4.tar.bz2
chat-885b8e51f3c0b0a4d98814b43917670c2193b3a4.zip
Merge remote-tracking branch 'origin/release-4.9' into merge49final
Diffstat (limited to 'utils/config.go')
-rw-r--r--utils/config.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/utils/config.go b/utils/config.go
index 7032dbad9..fa436f70d 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -84,13 +84,15 @@ func ConfigureCmdLineLog() {
ConfigureLog(&ls)
}
+// ConfigureLog enables and configures logging.
+//
+// Note that it is not currently possible to disable filters nor to modify previously enabled
+// filters, given the lack of concurrency guarantees from the underlying l4g library.
+//
// TODO: this code initializes console and file logging. It will eventually be replaced by JSON logging in logger/logger.go
// See PLT-3893 for more information
func ConfigureLog(s *model.LogSettings) {
-
- l4g.Close()
-
- if s.EnableConsole {
+ if _, alreadySet := l4g.Global["stdout"]; !alreadySet && s.EnableConsole {
level := l4g.DEBUG
if s.ConsoleLevel == "INFO" {
level = l4g.INFO
@@ -105,8 +107,7 @@ func ConfigureLog(s *model.LogSettings) {
l4g.AddFilter("stdout", level, lw)
}
- if s.EnableFile {
-
+ if _, alreadySet := l4g.Global["file"]; !alreadySet && s.EnableFile {
var fileFormat = s.FileFormat
if fileFormat == "" {