Enabled logging DEBUG in pytest
This commit is contained in:
@@ -124,7 +124,8 @@ def main() -> None:
|
||||
if args.debug:
|
||||
setup_logging(logging.DEBUG)
|
||||
log.debug("Debug log activated")
|
||||
setup_logging(logging.INFO)
|
||||
else:
|
||||
setup_logging(logging.INFO)
|
||||
|
||||
if not hasattr(args, "func"):
|
||||
return
|
||||
|
||||
@@ -3,7 +3,7 @@ import logging
|
||||
import shlex
|
||||
|
||||
from clan_cli import create_parser
|
||||
from clan_cli.custom_logger import get_caller
|
||||
from clan_cli.custom_logger import get_caller, setup_logging
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -11,10 +11,11 @@ log = logging.getLogger(__name__)
|
||||
class Cli:
|
||||
def run(self, args: list[str]) -> argparse.Namespace:
|
||||
parser = create_parser(prog="clan")
|
||||
cmd = shlex.join(["clan", *args])
|
||||
parsed = parser.parse_args(args)
|
||||
setup_logging(logging.DEBUG)
|
||||
cmd = shlex.join(["clan", "--debug", *args])
|
||||
log.debug(f"$ {cmd}")
|
||||
log.debug(f"Caller {get_caller()}")
|
||||
parsed = parser.parse_args(args)
|
||||
if hasattr(parsed, "func"):
|
||||
parsed.func(parsed)
|
||||
return parsed
|
||||
|
||||
Reference in New Issue
Block a user