Skip to content

Commit

Permalink
Refactor: updated logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Oct 29, 2023
1 parent 37c919c commit b8c74e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pkg/protocol/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ func NewChain(protocol *Protocol) *Chain {
})

c.Logger = protocol.NewEntityLogger("Chain", c.IsEvicted, func(entityLogger log.Logger) {
entityLogger.LogDebug("created")

c.WarpSync.LogUpdates(entityLogger, log.LevelTrace, "WarpSync")
c.NetworkClockSlot.LogUpdates(entityLogger, log.LevelTrace, "NetworkClockSlot")
c.WarpSyncThreshold.LogUpdates(entityLogger, log.LevelTrace, "WarpSyncThreshold")
Expand Down
4 changes: 2 additions & 2 deletions pkg/protocol/chain_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (c *ChainManager) PublishCommitment(commitment *model.Commitment) (commitme
})

if published = commitmentMetadata == publishedCommitmentMetadata; published {
c.protocol.LogDebug("new commitment created", "name", commitmentMetadata.LogName(), "id", commitment.ID())
commitmentMetadata.LogDebug("created", "id", commitment.ID())
}

return commitmentMetadata, commitmentMetadata == publishedCommitmentMetadata, nil
Expand Down Expand Up @@ -125,7 +125,7 @@ func (c *ChainManager) initMainChain() {

mainChain := NewChain(c.protocol)

c.protocol.LogDebug("new chain created", "name", mainChain.LogName(), "forkingPoint", "<snapshot>")
//c.protocol.LogDebug("new chain created", "name", mainChain.LogName(), "forkingPoint", "<snapshot>")

mainChain.VerifyState.Set(true)
mainChain.Engine.OnUpdate(func(_, newEngine *engine.Engine) { c.protocol.Events.Engine.LinkTo(newEngine.Events) })
Expand Down
3 changes: 0 additions & 3 deletions pkg/protocol/commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ func (c *Commitment) inheritChain(parent *Commitment) func(*Commitment, *Commitm
}

spawnedChain = NewChain(c.protocol)

c.protocol.LogDebug("new chain created", "name", spawnedChain.LogName(), "forkingPoint", c.LogName())

spawnedChain.ForkingPoint.Set(c)
}

Expand Down

0 comments on commit b8c74e3

Please sign in to comment.