[#465] Unify log messages

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-06-06 15:03:51 +03:00 committed by Alex Vanin
parent 300d4359d8
commit de7281ac58
6 changed files with 10 additions and 10 deletions

View file

@ -58,7 +58,7 @@ func (o *AccessBoxCache) Get(address oid.Address) *accessbox.Box {
result, ok := entry.(*accessbox.Box)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "*accessbox.Box"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}

View file

@ -47,7 +47,7 @@ func (o *BucketCache) Get(key string) *data.BucketInfo {
result, ok := entry.(*data.BucketInfo)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "*data.BucketInfo"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}

2
api/cache/names.go vendored
View file

@ -49,7 +49,7 @@ func (o *ObjectsNameCache) Get(key string) *oid.Address {
result, ok := entry.(oid.Address)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "oid.Address"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}

View file

@ -48,7 +48,7 @@ func (o *ObjectsCache) Get(address oid.Address) *object.Object {
result, ok := entry.(object.Object)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "object.Object"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}

View file

@ -70,7 +70,7 @@ func (l *ObjectsListCache) Get(key ObjectsListKey) []oid.ID {
result, ok := entry.([]oid.ID)
if !ok {
l.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "[]oid.ID"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}
@ -94,7 +94,7 @@ func (l *ObjectsListCache) CleanCacheEntriesContainingObject(objectName string,
k, ok := key.(ObjectsListKey)
if !ok {
l.logger.Warn("invalid cache key type", zap.String("actual", fmt.Sprintf("%T", key)),
zap.String("expected", "ObjectsListKey"))
zap.String("expected", fmt.Sprintf("%T", k)))
continue
}
if cidStr == k.cid && strings.HasPrefix(objectName, k.prefix) {

8
api/cache/system.go vendored
View file

@ -49,7 +49,7 @@ func (o *SystemCache) GetObject(key string) *data.ObjectInfo {
result, ok := entry.(*data.ObjectInfo)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "*data.ObjectInfo"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}
@ -65,7 +65,7 @@ func (o *SystemCache) GetCORS(key string) *data.CORSConfiguration {
result, ok := entry.(*data.CORSConfiguration)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "*data.CORSConfiguration"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}
@ -81,7 +81,7 @@ func (o *SystemCache) GetSettings(key string) *data.BucketSettings {
result, ok := entry.(*data.BucketSettings)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "*data.BucketSettings"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}
@ -97,7 +97,7 @@ func (o *SystemCache) GetNotificationConfiguration(key string) *data.Notificatio
result, ok := entry.(*data.NotificationConfiguration)
if !ok {
o.logger.Warn("invalid cache entry type", zap.String("actual", fmt.Sprintf("%T", entry)),
zap.String("expected", "*data.NotificationConfiguration"))
zap.String("expected", fmt.Sprintf("%T", result)))
return nil
}