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:
parent
dc49dbbeff
commit
68130122e7
23 changed files with 1128 additions and 909 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue