INNER CODE UNIT · Python
configure_logging
cubist38/mlx-openai-server · app/server.py:89
def configure_logging(
log_file: str | None = None, no_log_file: bool = False, log_level: str = "INFO"
) -> None:
"""Set up loguru handlers used by the server.
This helper replaces the default loguru handler with a console
handler using a compact, colored format. When ``no_log_file`` is
False a rotating file handler is also added using ``log_file`` or
a default path.
Parameters
----------
log_file:
Optional filesystem path where logs should be written. When
``None`` and file logging is enabled a sensible default
(``logs/app.log``) is used.
no_log_file:
When True, file logging is disabled and only console logs are