refactor: move debug logging setup to the command execution block in CLI

This commit is contained in:
Théophile Diot 2024-11-22 12:26:16 +01:00
parent cf8671655c
commit 3825b38fd8
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -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: