mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 18:12:19 +00:00
Remove duplicate logging initialization logic in utils.py (#1617)
This commit is contained in:
parent
c08fe48603
commit
4e97b19b63
@ -110,13 +110,6 @@ def str2bool(v):
|
|||||||
raise argparse.ArgumentTypeError("Boolean value expected.")
|
raise argparse.ArgumentTypeError("Boolean value expected.")
|
||||||
|
|
||||||
|
|
||||||
def clear_log_handlers():
|
|
||||||
logger = logging.getLogger()
|
|
||||||
handlers = logger.handlers[:]
|
|
||||||
for handler in handlers:
|
|
||||||
logger.removeHandler(handler)
|
|
||||||
|
|
||||||
|
|
||||||
def setup_logger(
|
def setup_logger(
|
||||||
log_filename: Pathlike,
|
log_filename: Pathlike,
|
||||||
log_level: str = "info",
|
log_level: str = "info",
|
||||||
@ -133,8 +126,6 @@ def setup_logger(
|
|||||||
use_console:
|
use_console:
|
||||||
True to also print logs to console.
|
True to also print logs to console.
|
||||||
"""
|
"""
|
||||||
clear_log_handlers()
|
|
||||||
|
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
date_time = now.strftime("%Y-%m-%d-%H-%M-%S")
|
date_time = now.strftime("%Y-%m-%d-%H-%M-%S")
|
||||||
if dist.is_available() and dist.is_initialized():
|
if dist.is_available() and dist.is_initialized():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user