forked from TrueCloudLab/frostfs-node
[#607] *: Use zap.Stringer() where possible
Semantic patch: ``` @@ var f expression var t expression var a expression @@ f( ..., - zap.String(t, a.String()), + zap.Stringer(t, a), ..., ) ``` Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
a8de37c8a2
commit
e604a3d749
5 changed files with 6 additions and 6 deletions
|
@ -104,14 +104,14 @@ func serveGRPC(c *cfg) {
|
|||
go func() {
|
||||
defer func() {
|
||||
c.log.Info(logs.FrostFSNodeStopListeningGRPCEndpoint,
|
||||
zap.String("endpoint", lis.Addr().String()),
|
||||
zap.Stringer("endpoint", lis.Addr()),
|
||||
)
|
||||
|
||||
c.wg.Done()
|
||||
}()
|
||||
|
||||
c.log.Info(logs.FrostFSNodeStartListeningGRPCEndpoint,
|
||||
zap.String("endpoint", lis.Addr().String()),
|
||||
zap.Stringer("endpoint", lis.Addr()),
|
||||
)
|
||||
|
||||
if err := srv.Serve(lis); err != nil {
|
||||
|
|
|
@ -45,7 +45,7 @@ func (np *Processor) processDeposit(deposit frostfsEvent.Deposit) bool {
|
|||
val, ok := np.mintEmitCache.Get(receiver.String())
|
||||
if ok && val+np.mintEmitThreshold >= curEpoch {
|
||||
np.log.Warn(logs.FrostFSDoubleMintEmissionDeclined,
|
||||
zap.String("receiver", receiver.String()),
|
||||
zap.Stringer("receiver", receiver),
|
||||
zap.Uint64("last_emission", val),
|
||||
zap.Uint64("current_epoch", curEpoch))
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ func (e *StorageEngine) RemoveDuplicates(ctx context.Context, prm RemoveDuplicat
|
|||
// This is not currently the case, because `FreeSpace` metric used by weight sorting is always 0.
|
||||
// However we could change weights in future and easily forget this function.
|
||||
for _, sh := range e.shards {
|
||||
e.log.Debug(logs.EngineStartedDuplicatesRemovalRoutine, zap.String("shard_id", sh.ID().String()))
|
||||
e.log.Debug(logs.EngineStartedDuplicatesRemovalRoutine, zap.Stringer("shard_id", sh.ID()))
|
||||
ch := make(chan oid.Address)
|
||||
|
||||
errG, ctx := errgroup.WithContext(ctx)
|
||||
|
|
|
@ -49,7 +49,7 @@ func (s *Shard) UpdateID() (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
s.log = &logger.Logger{Logger: s.log.With(zap.String("shard_id", s.info.ID.String()))}
|
||||
s.log = &logger.Logger{Logger: s.log.With(zap.Stringer("shard_id", s.info.ID))}
|
||||
s.metaBase.SetLogger(s.log)
|
||||
s.blobStor.SetLogger(s.log)
|
||||
if s.hasWriteCache() {
|
||||
|
|
|
@ -89,7 +89,7 @@ func (s *Service) verifyClient(req message, cid cidSDK.ID, rawBearer []byte, op
|
|||
if !basicACL.AllowedBearerRules(op) {
|
||||
s.log.Debug(logs.TreeBearerPresentedButNotAllowedByACL,
|
||||
zap.String("cid", cid.EncodeToString()),
|
||||
zap.String("op", op.String()),
|
||||
zap.Stringer("op", op),
|
||||
)
|
||||
} else {
|
||||
useBearer = true
|
||||
|
|
Loading…
Reference in a new issue