MCPcopy
hub / github.com/hpcaitech/ColossalAI / disable_existing_loggers

Function disable_existing_loggers

colossalai/logging/__init__.py:22–38  ·  view source on GitHub ↗

Set the level of existing loggers to `WARNING`. By default, it will "disable" all existing loggers except the logger named "colossalai". Args: include (Optional[List[str]], optional): Loggers whose name in this list will be disabled. If set to `None`, `exclude` argument will

(include: Optional[List[str]] = None, exclude: List[str] = ["colossalai"])

Source from the content-addressed store, hash-verified

20
21
22def disable_existing_loggers(include: Optional[List[str]] = None, exclude: List[str] = ["colossalai"]) -> None:
23 """Set the level of existing loggers to `WARNING`. By default, it will "disable" all existing loggers except the logger named "colossalai".
24
25 Args:
26 include (Optional[List[str]], optional): Loggers whose name in this list will be disabled.
27 If set to `None`, `exclude` argument will be used. Defaults to None.
28 exclude (List[str], optional): Loggers whose name not in this list will be disabled.
29 This argument will be used only when `include` is None. Defaults to ['colossalai'].
30 """
31 if include is None:
32 filter_func = lambda name: name not in exclude
33 else:
34 filter_func = lambda name: name in include
35
36 for log_name in logging.Logger.manager.loggerDict.keys():
37 if filter_func(log_name):
38 logging.getLogger(log_name).setLevel(logging.WARNING)

Callers 15

check_dist_lambFunction · 0.90
run_distFunction · 0.90
check_dist_galoreFunction · 0.90
run_distFunction · 0.90
check_extract_alpha_betaFunction · 0.90
check_alpha_betaFunction · 0.90
check_alpha_betaFunction · 0.90
check_layerFunction · 0.90
run_distFunction · 0.90
run_distFunction · 0.90
check_grad_clip_normFunction · 0.90
check_grad_clip_norm_3dFunction · 0.90

Calls

no outgoing calls

Tested by 15

check_dist_lambFunction · 0.72
run_distFunction · 0.72
check_dist_galoreFunction · 0.72
run_distFunction · 0.72
check_extract_alpha_betaFunction · 0.72
check_alpha_betaFunction · 0.72
check_alpha_betaFunction · 0.72
check_layerFunction · 0.72
run_distFunction · 0.72
run_distFunction · 0.72
check_grad_clip_normFunction · 0.72
check_grad_clip_norm_3dFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…