Skip to content

Commit dfff7e9

Browse files
authored
Merge pull request #604 from Roasbeef/debug-universe-logging
universe: use debug logging when no sync needed
2 parents 9939102 + 31bfd4f commit dfff7e9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

universe/syncer.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func (s *SimpleSyncer) syncRoot(ctx context.Context, remoteRoot BaseRoot,
169169

170170
// If the local root matches the remote root, then we're done here.
171171
case err == nil && mssmt.IsEqualNode(localRoot, remoteRoot):
172-
log.Infof("Root for %v matches, no sync needed",
172+
log.Debugf("Root for %v matches, no sync needed",
173173
uniID.String())
174174

175175
return nil
@@ -329,7 +329,8 @@ func (s *SimpleSyncer) batchStreamNewItems(ctx context.Context,
329329
ctx, fetchedLeaves, s.cfg.SyncBatchSize,
330330
func(ctx context.Context, batch []*IssuanceItem) error {
331331
numItems += len(batch)
332-
log.Infof("UniverseRoot(%v): Inserting %d new leaves "+
332+
333+
log.Debugf("UniverseRoot(%v): Inserting %d new leaves "+
333334
"(%d of %d)", uniID.String(), len(batch),
334335
numItems, numTotal)
335336

@@ -341,9 +342,11 @@ func (s *SimpleSyncer) batchStreamNewItems(ctx context.Context,
341342
"issuance proofs: %w", err)
342343
}
343344

344-
log.Infof("UniverseRoot(%v): Inserted %d new leaves "+
345-
"(%d of %d)", uniID.String(), len(batch),
346-
numItems, numTotal)
345+
if len(batch) > 0 {
346+
log.Infof("UniverseRoot(%v): Inserted %d new "+
347+
"leaves (%d of %d)", uniID.String(),
348+
len(batch), numItems, numTotal)
349+
}
347350

348351
newLeaves := fn.Map(
349352
batch, func(i *IssuanceItem) *Leaf {

0 commit comments

Comments
 (0)