Skip to content

Commit 568a472

Browse files
karalabeDergarcon
authored andcommitted
cmd/geth, internal/debug: get rid of by-default log config (ethereum#28801)
1 parent 5433629 commit 568a472

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

cmd/geth/logtestcmd_active.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"time"
2727

2828
"github.com/ethereum/go-ethereum/common"
29-
"github.com/ethereum/go-ethereum/internal/debug"
3029
"github.com/ethereum/go-ethereum/log"
3130
"github.com/holiman/uint256"
3231
"github.com/urfave/cli/v2"
@@ -51,9 +50,6 @@ func (c customQuotedStringer) String() string {
5150
// logTest is an entry point which spits out some logs. This is used by testing
5251
// to verify expected outputs
5352
func logTest(ctx *cli.Context) error {
54-
// clear field padding map
55-
debug.ResetLogging()
56-
5753
{ // big.Int
5854
ba, _ := new(big.Int).SetString("111222333444555678999", 10) // "111,222,333,444,555,678,999"
5955
bb, _ := new(big.Int).SetString("-111222333444555678999", 10) // "-111,222,333,444,555,678,999"

internal/debug/flags.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,12 @@ var Flags = []cli.Flag{
168168
}
169169

170170
var (
171-
glogger *log.GlogHandler
172-
logOutputFile io.WriteCloser
173-
defaultTerminalHandler *log.TerminalHandler
171+
glogger *log.GlogHandler
172+
logOutputFile io.WriteCloser
174173
)
175174

176175
func init() {
177-
defaultTerminalHandler = log.NewTerminalHandler(os.Stderr, false)
178-
glogger = log.NewGlogHandler(defaultTerminalHandler)
179-
glogger.Verbosity(log.LvlInfo)
180-
log.SetDefault(log.NewLogger(glogger))
181-
}
182-
183-
func ResetLogging() {
184-
if defaultTerminalHandler != nil {
185-
defaultTerminalHandler.ResetFieldPadding()
186-
}
176+
glogger = log.NewGlogHandler(log.NewTerminalHandler(os.Stderr, false))
187177
}
188178

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

0 commit comments

Comments
 (0)