From 222ff11fd953f44f31c54646bc0fda63659b8028 Mon Sep 17 00:00:00 2001 From: Earl Warren <109468362+earl-warren@users.noreply.github.com> Date: Thu, 26 Jan 2023 03:09:09 +0100 Subject: [PATCH] fix SetupConsoleLogger which is a noop (#1564) When App.Before is called the options are not parsed yet, use Command.Before instead. --- cmd/cli/app.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/cli/app.go b/cmd/cli/app.go index 330588292..c3051ca20 100644 --- a/cmd/cli/app.go +++ b/cmd/cli/app.go @@ -65,7 +65,9 @@ func newApp() *cli.App { Out: os.Stderr, }, ) - app.Before = common.SetupConsoleLogger + for _, command := range app.Commands { + command.Before = common.SetupConsoleLogger + } return app }