diff --git a/cmd/devp2p/main.go b/cmd/devp2p/main.go index 6faa650937..b895941f25 100644 --- a/cmd/devp2p/main.go +++ b/cmd/devp2p/main.go @@ -45,7 +45,7 @@ func init() { // Set up the CLI app. app.Flags = append(app.Flags, debug.Flags...) app.Before = func(ctx *cli.Context) error { - return debug.Setup(ctx, "") + return debug.Setup(ctx) } app.After = func(ctx *cli.Context) error { debug.Exit() diff --git a/cmd/geth/main.go b/cmd/geth/main.go index d6ded24b31..8db19077a8 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -233,7 +233,7 @@ func init() { app.Flags = append(app.Flags, metricsFlags...) app.Before = func(ctx *cli.Context) error { - return debug.Setup(ctx, "") + return debug.Setup(ctx) } app.After = func(ctx *cli.Context) error { debug.Exit() diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 46c8fe9f80..3c85749402 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -112,20 +112,9 @@ func init() { // Setup initializes profiling and logging based on the CLI flags. // It should be called as early as possible in the program. -func Setup(ctx *cli.Context, logdir string) error { +func Setup(ctx *cli.Context) error { // logging log.PrintOrigins(ctx.GlobalBool(debugFlag.Name)) - if logdir != "" { - rfh, err := log.RotatingFileHandler( - logdir, - 262144, - log.JSONFormatOrderedEx(false, true), - ) - if err != nil { - return err - } - glogger.SetHandler(log.MultiHandler(ostream, rfh)) - } glogger.Verbosity(log.Lvl(ctx.GlobalInt(verbosityFlag.Name))) glogger.Vmodule(ctx.GlobalString(vmoduleFlag.Name)) glogger.BacktraceAt(ctx.GlobalString(backtraceAtFlag.Name))