availcheck.util
1# -*- coding: utf-8 -*- 2# Copyright (C) 2024 TU Dresden 3# ralf.klammer@tu-dresden.de 4import logging 5 6log = logging.getLogger(__name__) 7 8 9def cli_startup(log_level=logging.INFO, log_file=None): 10 log_config = dict( 11 level=log_level, 12 format="%(asctime)s %(name)-10s %(levelname)-4s %(message)s", 13 ) 14 if log_file: 15 log_config["filename"] = log_file 16 17 logging.basicConfig(**log_config) 18 logging.getLogger("").setLevel(log_level)
log =
<Logger availcheck.util (WARNING)>
def
cli_startup(log_level=20, log_file=None):
10def cli_startup(log_level=logging.INFO, log_file=None): 11 log_config = dict( 12 level=log_level, 13 format="%(asctime)s %(name)-10s %(levelname)-4s %(message)s", 14 ) 15 if log_file: 16 log_config["filename"] = log_file 17 18 logging.basicConfig(**log_config) 19 logging.getLogger("").setLevel(log_level)