switch graph to struct tag based env config

This commit is contained in:
Willy Kloucek
2022-01-07 15:39:01 +00:00
committed by Jörn Friedrich Dreyer
parent 788a390016
commit 288d6c469e
8 changed files with 92 additions and 235 deletions
+17
View File
@@ -0,0 +1,17 @@
package logging
import (
"github.com/owncloud/ocis/graph/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
)
// LoggerFromConfig initializes a service-specific logger instance.
func Configure(name string, cfg config.Log) log.Logger {
return log.NewLogger(
log.Name(name),
log.Level(cfg.Level),
log.Pretty(cfg.Pretty),
log.Color(cfg.Color),
log.File(cfg.File),
)
}