Download microsoftexcel-controlnet/annotator/mmpkg/mmseg/utils/logger.py from toto10/extensions: direct link, hf CLI and curl.
- Browser
- Download file 915 Bytes
-
https://huggingface.co/toto10/extensions/resolve/refs%2Fpr%2F7/microsoftexcel-controlnet/annotator/mmpkg/mmseg/utils/logger.py
- Command line
-
hf download hf://toto10/extensions@refs/pr/7/microsoftexcel-controlnet/annotator/mmpkg/mmseg/utils/logger.py
-
curl -L -o logger.py https://huggingface.co/toto10/extensions/resolve/refs%2Fpr%2F7/microsoftexcel-controlnet/annotator/mmpkg/mmseg/utils/logger.py
915 Bytes
| import logging | |
| from annotator.mmpkg.mmcv.utils import get_logger | |
| def get_root_logger(log_file=None, log_level=logging.INFO): | |
| """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., "mmseg". | |
| Args: | |
| log_file (str | None): The log filename. If specified, a FileHandler | |
| will be added to the root logger. | |
| log_level (int): The root logger level. Note that only the process of | |
| rank 0 is affected, while other processes will set the level to | |
| "Error" and be silent most of the time. | |
| Returns: | |
| logging.Logger: The root logger. | |
| """ | |
| logger = get_logger(name='mmseg', log_file=log_file, log_level=log_level) | |
| return logger | |