1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 03:55:24 +02:00

refactored flag/env loading

This commit is contained in:
Harvey Kandola 2017-07-19 18:47:01 +01:00
parent dc49dbbeff
commit 68130122e7
23 changed files with 1128 additions and 909 deletions

View file

@ -19,23 +19,14 @@ import (
"runtime"
log "github.com/Sirupsen/logrus"
"github.com/documize/community/core/env"
)
var environment = "Non-production"
func init() {
log.SetFormatter(new(log.TextFormatter))
log.SetOutput(os.Stdout)
log.SetLevel(log.DebugLevel)
env.GetString(&environment, "log", false,
"system being logged e.g. 'PRODUCTION'",
func(*string, string) bool {
log.Infoln(environment + " environment logging enabled")
return false
})
}
// Debug logs a message for debug purposes.