from fba.helpers import locking
-logging.basicConfig(level=logging.WARNING)
+logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Argument parser
description="Fetches block reasons from the fediverse",
epilog="Please note that some commands have optional arguments, you may want to try fba.py <command> --help to find them out.",
)
+
+ # Generic:
+ _PARSER.add_argument("--debug", action="store_const", dest="log_level", const=logging.DEBUG, help="Full debug output")
+
+ # Commands:
subparser_command = _PARSER.add_subparsers(
dest="command",
title="Commands to execute",
def run_command():
logger.debug("run_command(): CALLED!")
args = _PARSER.parse_args()
+
+ if args.log_level is not None:
+ loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]
+ for _logger in loggers:
+ _logger.setLevel(args.log_level)
+
logger.debug(f"args[{type(args)}]={args}")
status = args.command(args)
logger.debug("status={status} - EXIT!")