mstar.utils.logging_config

mstar.utils.logging_config#

Functions

log_off_thread()

Hand the root logger's records to a thread that writes them.

quiet_noisy_loggers([level])

Raise chatty third-party loggers to level (default WARNING).

mstar.utils.logging_config.log_off_thread()[source]#

Hand the root logger’s records to a thread that writes them.

A loop that logs on every request otherwise writes to stderr itself, under the handler’s lock, and a stderr redirected to a file blocks while the kernel writes back dirty pages. Call once after logging.basicConfig. Returns the drain, which also runs at exit and puts the handlers back.

Return type:

Callable[[], None]

mstar.utils.logging_config.quiet_noisy_loggers(level=logging.WARNING)[source]#

Raise chatty third-party loggers to level (default WARNING).

Per-logger levels are independent of the root level, so this suppresses the per-request HTTP noise from weight downloads while mstar keeps a global INFO level. Call once after logging.basicConfig in each process.

Parameters:

level (int)

Return type:

None