From de7281ac583a16e49eda66578bf07f84731c888d Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 6 Jun 2022 15:03:51 +0300 Subject: [PATCH] [#465] Unify log messages Signed-off-by: Denis Kirillov --- api/cache/accessbox.go | 2 +- api/cache/buckets.go | 2 +- api/cache/names.go | 2 +- api/cache/objects.go | 2 +- api/cache/objectslist.go | 4 ++-- api/cache/system.go | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/cache/accessbox.go b/api/cache/accessbox.go index fc11d646..ef9c2763 100644 --- a/api/cache/accessbox.go +++ b/api/cache/accessbox.go @@ -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 } diff --git a/api/cache/buckets.go b/api/cache/buckets.go index 2e16a553..bb719600 100644 --- a/api/cache/buckets.go +++ b/api/cache/buckets.go @@ -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 } diff --git a/api/cache/names.go b/api/cache/names.go index 441fae96..f27226bf 100644 --- a/api/cache/names.go +++ b/api/cache/names.go @@ -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 } diff --git a/api/cache/objects.go b/api/cache/objects.go index 4e247d1b..6628852d 100644 --- a/api/cache/objects.go +++ b/api/cache/objects.go @@ -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 } diff --git a/api/cache/objectslist.go b/api/cache/objectslist.go index d223db22..e28d47b9 100644 --- a/api/cache/objectslist.go +++ b/api/cache/objectslist.go @@ -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) { diff --git a/api/cache/system.go b/api/cache/system.go index 708555a6..ce025aa2 100644 --- a/api/cache/system.go +++ b/api/cache/system.go @@ -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 }