registry: configureLogging() simplify logic a bit
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f1dff3e434
commit
b73c038000
1 changed files with 2 additions and 8 deletions
|
@ -367,16 +367,10 @@ func configureLogging(ctx context.Context, config *configuration.Configuration)
|
||||||
Formatter: &logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano},
|
Formatter: &logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano},
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
// just let the library use default on empty string.
|
return ctx, fmt.Errorf("unsupported logging formatter: %q", formatter)
|
||||||
if config.Log.Formatter != "" {
|
|
||||||
return ctx, fmt.Errorf("unsupported logging formatter: %q", config.Log.Formatter)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if config.Log.Formatter != "" {
|
|
||||||
logrus.Debugf("using %q logging formatter", config.Log.Formatter)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logrus.Debugf("using %q logging formatter", formatter)
|
||||||
if len(config.Log.Fields) > 0 {
|
if len(config.Log.Fields) > 0 {
|
||||||
// build up the static fields, if present.
|
// build up the static fields, if present.
|
||||||
var fields []interface{}
|
var fields []interface{}
|
||||||
|
|
Loading…
Reference in a new issue