MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / enable_explicit_format

Function enable_explicit_format

diffusers/src/diffusers/utils/logging.py:241–253  ·  view source on GitHub ↗

Enable explicit formatting for every 🤗 Diffusers' 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.

()

Source from the content-addressed store, hash-verified

239
240
241def enable_explicit_format() -> None:
242 """
243 Enable explicit formatting for every 🤗 Diffusers' logger. The explicit formatter is as follows:
244 ```
245 [LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE
246 ```
247 All handlers currently bound to the root logger are affected by this method.
248 """
249 handlers = _get_library_root_logger().handlers
250
251 for handler in handlers:
252 formatter = logging.Formatter("[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s >> %(message)s")
253 handler.setFormatter(formatter)
254
255
256def reset_format() -> None:

Callers

nothing calls this directly

Calls 1

_get_library_root_loggerFunction · 0.85

Tested by

no test coverage detected