Skip to content

Commit

Permalink
refactor(gov): consistent logger usage in EndBlocker() (#18560)
Browse files Browse the repository at this point in the history
  • Loading branch information
taeguk committed Nov 27, 2023
1 parent 21032c9 commit 02b1b00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/gov/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker)

logger := ctx.Logger().With("module", "x/"+types.ModuleName)
logger := keeper.Logger(ctx)
// delete dead proposals from store and returns theirs deposits.
// A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase.
rng := collections.NewPrefixUntilPairRange[time.Time, uint64](ctx.HeaderInfo().Time)
Expand Down Expand Up @@ -70,7 +70,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error {
if err == nil { // purposely ignoring the error here not to halt the chain if the hook fails
writeCache()
} else {
keeper.Logger(ctx).Error("failed to execute AfterProposalFailedMinDeposit hook", "error", err)
logger.Error("failed to execute AfterProposalFailedMinDeposit hook", "error", err)
}

ctx.EventManager().EmitEvent(
Expand Down Expand Up @@ -239,7 +239,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error {
if err == nil { // purposely ignoring the error here not to halt the chain if the hook fails
writeCache()
} else {
keeper.Logger(ctx).Error("failed to execute AfterProposalVotingPeriodEnded hook", "error", err)
logger.Error("failed to execute AfterProposalVotingPeriodEnded hook", "error", err)
}

logger.Info(
Expand Down

0 comments on commit 02b1b00

Please sign in to comment.