Change ENV prefix

TODO should be replaced with HTTP_GW before release

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
Evgeniy Kulikov 2020-11-27 18:18:53 +03:00
parent f75eb4b803
commit 31186382e8
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
4 changed files with 88 additions and 24 deletions

18
main.go
View file

@ -9,23 +9,23 @@ import (
func newLogger(v *viper.Viper) *zap.Logger {
options := []logger.Option{
logger.WithLevel(v.GetString("logger.level")),
logger.WithTraceLevel(v.GetString("logger.trace_level")),
logger.WithLevel(v.GetString(cfgLoggerLevel)),
logger.WithTraceLevel(v.GetString(cfgLoggerTraceLevel)),
logger.WithFormat(v.GetString("logger.format")),
logger.WithFormat(v.GetString(cfgLoggerFormat)),
logger.WithSamplingInitial(v.GetInt("logger.sampling.initial")),
logger.WithSamplingThereafter(v.GetInt("logger.sampling.thereafter")),
logger.WithSamplingInitial(v.GetInt(cfgLoggerSamplingInitial)),
logger.WithSamplingThereafter(v.GetInt(cfgLoggerSamplingThereafter)),
logger.WithAppName(v.GetString("app_name")),
logger.WithAppVersion(v.GetString("app_version")),
logger.WithAppName(v.GetString(cfgApplicationName)),
logger.WithAppVersion(v.GetString(cfgApplicationVersion)),
}
if v.GetBool("logger.no_caller") {
if v.GetBool(cfgLoggerNoCaller) {
options = append(options, logger.WithoutCaller())
}
if v.GetBool("logger.no_disclaimer") {
if v.GetBool(cfgLoggerNoDisclaimer) {
options = append(options, logger.WithoutDisclaimer())
}