log/level
This commit is contained in:
parent
3ce03d17c1
commit
282e2ac7a1
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue