[#70] Fix log messages (move to constants)
All checks were successful
/ DCO (pull_request) Successful in 1m14s
/ Builds (1.20) (pull_request) Successful in 2m13s
/ Builds (1.21) (pull_request) Successful in 1m43s
/ Vulncheck (pull_request) Successful in 2m2s
/ Lint (pull_request) Successful in 4m2s
/ Tests (1.20) (pull_request) Successful in 2m16s
/ Tests (1.21) (pull_request) Successful in 1m41s
All checks were successful
/ DCO (pull_request) Successful in 1m14s
/ Builds (1.20) (pull_request) Successful in 2m13s
/ Builds (1.21) (pull_request) Successful in 1m43s
/ Vulncheck (pull_request) Successful in 2m2s
/ Lint (pull_request) Successful in 4m2s
/ Tests (1.20) (pull_request) Successful in 2m16s
/ Tests (1.21) (pull_request) Successful in 1m41s
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
4369f37db9
commit
77e4436ccf
2 changed files with 5 additions and 2 deletions
|
@ -560,7 +560,7 @@ func fetchCacheLifetime(v *viper.Viper, l *zap.Logger, cfgEntry string, defaultV
|
|||
if v.IsSet(cfgEntry) {
|
||||
lifetime := v.GetDuration(cfgEntry)
|
||||
if lifetime <= 0 {
|
||||
l.Error("invalid lifetime, using default value (in seconds)",
|
||||
l.Error(logs.InvalidLifetimeUsingDefaultValue,
|
||||
zap.String("parameter", cfgEntry),
|
||||
zap.Duration("value in config", lifetime),
|
||||
zap.Duration("default", defaultValue))
|
||||
|
@ -576,7 +576,7 @@ func fetchCacheSize(v *viper.Viper, l *zap.Logger, cfgEntry string, defaultValue
|
|||
if v.IsSet(cfgEntry) {
|
||||
size := v.GetInt(cfgEntry)
|
||||
if size <= 0 {
|
||||
l.Error("invalid cache size, using default value",
|
||||
l.Error(logs.InvalidCacheSizeUsingDefaultValue,
|
||||
zap.String("parameter", cfgEntry),
|
||||
zap.Int("value in config", size),
|
||||
zap.Int("default", defaultValue))
|
||||
|
|
|
@ -70,4 +70,7 @@ const (
|
|||
CouldntGetBucket = "could not get bucket" // Error in ../handler/utils.go
|
||||
CouldntPutBucketIntoCache = "couldn't put bucket info into cache" // Warn in ../handler/handler.go
|
||||
InvalidCacheEntryType = "invalid cache entry type" // Warn in ../cache/buckets.go
|
||||
InvalidLifetimeUsingDefaultValue = "invalid lifetime, using default value (in seconds)" // Error in ../../cmd/http-gw/settings.go
|
||||
InvalidCacheSizeUsingDefaultValue = "invalid cache size, using default value" // Error in ../../cmd/http-gw/settings.go
|
||||
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue