[#1611] shard: Print shard ID in component logs
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
9f7a22e2aa
commit
11c9df6f00
4 changed files with 27 additions and 0 deletions
|
@ -24,6 +24,7 @@ type Cache interface {
|
|||
Iterate(IterationPrm) error
|
||||
Put(*object.Object) error
|
||||
SetMode(Mode)
|
||||
SetLogger(*zap.Logger)
|
||||
DumpInfo() Info
|
||||
|
||||
Init() error
|
||||
|
@ -111,6 +112,11 @@ func New(opts ...Option) Cache {
|
|||
return c
|
||||
}
|
||||
|
||||
// SetLogger sets logger. It is used after the shard ID was generated to use it in logs.
|
||||
func (c *cache) SetLogger(l *zap.Logger) {
|
||||
c.log = l
|
||||
}
|
||||
|
||||
func (c *cache) DumpInfo() Info {
|
||||
return Info{
|
||||
Path: c.path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue