log/level

This commit is contained in:
Marc Beninca 2024-06-13 10:16:53 +02:00
parent 3ce03d17c1
commit 282e2ac7a1
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -18,15 +18,15 @@ def get_file_logger(name: str) -> logging.Logger:
return logger return logger
def get_stream_logger() -> logging.Logger: def get_stream_logger(level: int) -> logging.Logger:
out_handler = logging.StreamHandler(stream=sys.stdout) out_handler = logging.StreamHandler(stream=sys.stdout)
out_handler.setLevel(logging.INFO) out_handler.setLevel(level)
# #
logger = logging.getLogger() logger = logging.getLogger()
logger.addHandler(out_handler) logger.addHandler(out_handler)
logger.setLevel(logging.INFO) logger.setLevel(level)
# #
return logger return logger
stream = get_stream_logger() stream = get_stream_logger(logging.INFO)