internal/debug: remove unused RotatingFileHandler setup code

This commit is contained in:
Felix Lange 2020-01-21 11:25:45 +01:00
parent 4e0f3cf3d8
commit 9126062289
3 changed files with 3 additions and 14 deletions

View file

@ -45,7 +45,7 @@ func init() {
// Set up the CLI app. // Set up the CLI app.
app.Flags = append(app.Flags, debug.Flags...) app.Flags = append(app.Flags, debug.Flags...)
app.Before = func(ctx *cli.Context) error { app.Before = func(ctx *cli.Context) error {
return debug.Setup(ctx, "") return debug.Setup(ctx)
} }
app.After = func(ctx *cli.Context) error { app.After = func(ctx *cli.Context) error {
debug.Exit() debug.Exit()

View file

@ -233,7 +233,7 @@ func init() {
app.Flags = append(app.Flags, metricsFlags...) app.Flags = append(app.Flags, metricsFlags...)
app.Before = func(ctx *cli.Context) error { app.Before = func(ctx *cli.Context) error {
return debug.Setup(ctx, "") return debug.Setup(ctx)
} }
app.After = func(ctx *cli.Context) error { app.After = func(ctx *cli.Context) error {
debug.Exit() debug.Exit()

View file

@ -112,20 +112,9 @@ func init() {
// Setup initializes profiling and logging based on the CLI flags. // Setup initializes profiling and logging based on the CLI flags.
// It should be called as early as possible in the program. // 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 // logging
log.PrintOrigins(ctx.GlobalBool(debugFlag.Name)) 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.Verbosity(log.Lvl(ctx.GlobalInt(verbosityFlag.Name)))
glogger.Vmodule(ctx.GlobalString(vmoduleFlag.Name)) glogger.Vmodule(ctx.GlobalString(vmoduleFlag.Name))
glogger.BacktraceAt(ctx.GlobalString(backtraceAtFlag.Name)) glogger.BacktraceAt(ctx.GlobalString(backtraceAtFlag.Name))