From 91260622897b59ad482aa97ee5f2deb1adb85011 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 21 Jan 2020 11:25:45 +0100 Subject: [PATCH] internal/debug: remove unused RotatingFileHandler setup code --- cmd/devp2p/main.go | 2 +- cmd/geth/main.go | 2 +- internal/debug/flags.go | 13 +------------ 3 files changed, 3 insertions(+), 14 deletions(-) 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))