Skip to content

Commit

Permalink
only log compression algo if present
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianst committed May 21, 2024
1 parent e7c1fb3 commit 654f269
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion op-node/rollup/derive/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ type batchWithMetadata struct {
}

func (b batchWithMetadata) LogContext(l log.Logger) log.Logger {
return b.Batch.LogContext(l).With("compression_algo", b.comprAlgo)
lgr := b.Batch.LogContext(l)
if b.comprAlgo == "" {
return lgr
}
return lgr.With("compression_algo", b.comprAlgo)
}

// BatchData is used to represent the typed encoding & decoding.
Expand Down

0 comments on commit 654f269

Please sign in to comment.