Add public setup_logging() for standalone pretty logging

Optionally usable early in CLI mains, devservers and scripts that log
before (or without) server.run().  Shares patch_log_config with the
server path (same log_config overrides), but installs no server-side
patches: Formatter gains an install flag gating the lifespan/error
middleware monkeypatches, and the NullHandler backdoor is skipped.
dev=None follows env.dev for the root level, True/False override it.
Pre-existing loggers survive the dictConfig (disable_existing_loggers
is set False).
This commit is contained in:
2026-09-18 02:49:16 +00:00
parent 1d4a0a5422
commit 0f5b526df6
2 changed files with 50 additions and 15 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
"""FastAPI Vue integration - serve Vue frontend from FastAPI."""
from .environ import env, teleport
from .logging import setup_logging
from .staticfiles import Frontend
__all__ = ["Frontend", "env", "teleport"]
__all__ = ["Frontend", "env", "setup_logging", "teleport"]