Download scDFM/src/utils/_logging.py from tintin1027/final: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/tintin1027/final/resolve/main/scDFM/src/utils/_logging.py
- Command line
-
hf download hf://tintin1027/final/scDFM/src/utils/_logging.py
-
curl -L -o _logging.py https://huggingface.co/tintin1027/final/resolve/main/scDFM/src/utils/_logging.py
555 Bytes
| import logging | |
| __all__ = ["logger"] | |
| def _setup_logger() -> "logging.Logger": | |
| from rich.console import Console | |
| from rich.logging import RichHandler | |
| logger = logging.getLogger(__name__) | |
| logger.setLevel(logging.INFO) | |
| console = Console(force_terminal=True) | |
| if console.is_jupyter is True: | |
| console.is_jupyter = False | |
| ch = RichHandler(show_path=False, console=console, show_time=False) | |
| logger.addHandler(ch) | |
| # this prevents double outputs | |
| logger.propagate = False | |
| return logger | |
| logger = _setup_logger() | |