MCPcopy
hub / github.com/alibaba/EasyCV / get_root_logger

Function get_root_logger

easycv/utils/logger.py:9–28  ·  view source on GitHub ↗

Get the root logger. The logger will be initialized if it has not been initialized. By default a StreamHandler will be added. If `log_file` is specified, a FileHandler will also be added. The name of the root logger is the top-level package name, e.g., "easycv". Args: l

(log_file=None, log_level=logging.INFO)

Source from the content-addressed store, hash-verified

7
8
9def get_root_logger(log_file=None, log_level=logging.INFO):
10 """Get the root logger.
11
12 The logger will be initialized if it has not been initialized. By default a
13 StreamHandler will be added. If `log_file` is specified, a FileHandler will
14 also be added. The name of the root logger is the top-level package name,
15 e.g., "easycv".
16
17 Args:
18 log_file (str | None): The log filename. If specified, a FileHandler
19 will be added to the root logger.
20 log_level (int): The root logger level. Note that only the process of
21 rank 0 is affected, while other processes will set the level to
22 "Error" and be silent most of the time.
23
24 Returns:
25 logging.Logger: The root logger.
26 """
27 return get_logger(
28 __name__.split('.')[0], log_file=log_file, log_level=log_level)
29
30
31def print_log(msg, logger=None, level=logging.INFO):

Callers 15

patch_loggingFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
train_modelFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90
init_weightsMethod · 0.90
init_weightsMethod · 0.90
init_weightsMethod · 0.90
init_weightsMethod · 0.90

Calls

no outgoing calls

Tested by 8

test_export_hookMethod · 0.72
_runMethod · 0.72
test_best_ckpt_saverMethod · 0.72
test_byol_hookMethod · 0.72
test_ema_hookMethod · 0.72
test_byol_hookMethod · 0.72
_runMethod · 0.72
test_swav_hookMethod · 0.72