Skip to content

Commit

Permalink
chore: disable logger on prune command (#1414)
Browse files Browse the repository at this point in the history
  • Loading branch information
b00f authored Jul 13, 2024
1 parent 89ba289 commit 70c03b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/daemon/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/gofrs/flock"
"github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/store"
"github.com/pactus-project/pactus/util/logger"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -48,6 +49,10 @@ func buildPruneCmd(parentCmd *cobra.Command) {
conf, _, err := cmd.MakeConfig(workingDir)
cmd.FatalErrorCheck(err)

// Disable logger
conf.Logger.Targets = []string{}
logger.InitGlobalLogger(conf.Logger)

cmd.PrintLine()
cmd.PrintWarnMsgf("This command removes all the blocks and transactions up to %d days ago "+
"and converts the node to prune mode.", conf.Store.RetentionDays)
Expand Down

0 comments on commit 70c03b4

Please sign in to comment.