From 3825b38fd801bf4d29d69c8afb46563c8ff8fbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Fri, 22 Nov 2024 12:26:16 +0100 Subject: [PATCH] refactor: move debug logging setup to the command execution block in CLI --- src/common/cli/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/cli/main.py b/src/common/cli/main.py index 69f48793e..0cd4e6b9b 100644 --- a/src/common/cli/main.py +++ b/src/common/cli/main.py @@ -60,9 +60,6 @@ if __name__ == "__main__": # Parse args args = parser.parse_args() - if args.debug: - logger.setLevel("DEBUG") - # Instantiate CLI cli = CLI() @@ -75,6 +72,9 @@ if __name__ == "__main__": elif args.command == "bans": ret, err = cli.bans() else: + if args.debug: + logger.setLevel("DEBUG") + ret, err = cli.custom(args.plugin_id, args.command, *args.arg, debug=args.debug) if not ret: