Skip to content

Commit

Permalink
cmd/geth, internal/debug: get rid of by-default log config (ethereum#…
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe authored and Dergarcon committed Jan 31, 2024
1 parent 5433629 commit 568a472
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
4 changes: 0 additions & 4 deletions cmd/geth/logtestcmd_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/log"
"github.com/holiman/uint256"
"github.com/urfave/cli/v2"
Expand All @@ -51,9 +50,6 @@ func (c customQuotedStringer) String() string {
// logTest is an entry point which spits out some logs. This is used by testing
// to verify expected outputs
func logTest(ctx *cli.Context) error {
// clear field padding map
debug.ResetLogging()

{ // big.Int
ba, _ := new(big.Int).SetString("111222333444555678999", 10) // "111,222,333,444,555,678,999"
bb, _ := new(big.Int).SetString("-111222333444555678999", 10) // "-111,222,333,444,555,678,999"
Expand Down
16 changes: 3 additions & 13 deletions internal/debug/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,22 +168,12 @@ var Flags = []cli.Flag{
}

var (
glogger *log.GlogHandler
logOutputFile io.WriteCloser
defaultTerminalHandler *log.TerminalHandler
glogger *log.GlogHandler
logOutputFile io.WriteCloser
)

func init() {
defaultTerminalHandler = log.NewTerminalHandler(os.Stderr, false)
glogger = log.NewGlogHandler(defaultTerminalHandler)
glogger.Verbosity(log.LvlInfo)
log.SetDefault(log.NewLogger(glogger))
}

func ResetLogging() {
if defaultTerminalHandler != nil {
defaultTerminalHandler.ResetFieldPadding()
}
glogger = log.NewGlogHandler(log.NewTerminalHandler(os.Stderr, false))
}

// Setup initializes profiling and logging based on the CLI flags.
Expand Down

0 comments on commit 568a472

Please sign in to comment.