Enable explicit formatting for every HuggingFace Transformers's logger. The explicit formatter is as follows: ``` [LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE ``` All handlers currently bound to the root logger are affected by this method.
()
| 225 | |
| 226 | |
| 227 | def enable_explicit_format() -> None: |
| 228 | """ |
| 229 | Enable explicit formatting for every HuggingFace Transformers's logger. The explicit formatter is as follows: |
| 230 | ``` |
| 231 | [LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE |
| 232 | ``` |
| 233 | All handlers currently bound to the root logger are affected by this method. |
| 234 | """ |
| 235 | handlers = _get_library_root_logger().handlers |
| 236 | |
| 237 | for handler in handlers: |
| 238 | formatter = logging.Formatter("[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s") |
| 239 | handler.setFormatter(formatter) |
| 240 | |
| 241 | |
| 242 | def reset_format() -> None: |
nothing calls this directly
no test coverage detected