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.
()
| 288 | |
| 289 | |
| 290 | def enable_explicit_format() -> None: |
| 291 | """ |
| 292 | Enable explicit formatting for every HuggingFace Transformers's logger. The explicit formatter is as follows: |
| 293 | ``` |
| 294 | [LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE |
| 295 | ``` |
| 296 | All handlers currently bound to the root logger are affected by this method. |
| 297 | """ |
| 298 | handlers = _get_library_root_logger().handlers |
| 299 | |
| 300 | for handler in handlers: |
| 301 | formatter = logging.Formatter("[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s") |
| 302 | handler.setFormatter(formatter) |
| 303 | |
| 304 | |
| 305 | def reset_format() -> None: |
nothing calls this directly
no test coverage detected