From 80e37483a326cb3e40e6247de92bc1b80a68a350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 4 Oct 2023 08:06:11 +0200 Subject: [PATCH] don't register global logger, this interferes currently with that we have in ssh.py --- pkgs/clan-cli/clan_cli/__init__.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/__init__.py b/pkgs/clan-cli/clan_cli/__init__.py index 7cd2c3a28..49771ad13 100644 --- a/pkgs/clan-cli/clan_cli/__init__.py +++ b/pkgs/clan-cli/clan_cli/__init__.py @@ -1,15 +1,12 @@ import argparse -import logging import sys from types import ModuleType from typing import Optional -from . import config, create, custom_logger, machines, secrets, vms, webui +from . import config, create, machines, secrets, vms, webui from .errors import ClanError from .ssh import cli as ssh_cli -log = logging.getLogger(__name__) - argcomplete: Optional[ModuleType] = None try: import argcomplete # type: ignore[no-redef] @@ -66,19 +63,12 @@ def main() -> None: parser = create_parser() args = parser.parse_args() - if args.debug: - custom_logger.register(logging.DEBUG) - log.debug("Debug logging enabled") - else: - custom_logger.register(logging.INFO) - if not hasattr(args, "func"): - log.error("No argparse function registered") return try: args.func(args) except ClanError as e: - log.exception(e) + print(e, file=sys.stderr) sys.exit(1)