doc: add missing docstring + add missing feature to README (#57)

This commit is contained in:
d3vyce
2026-02-12 18:09:39 +01:00
committed by GitHub
parent c8c263ca8f
commit 8825c772ce
13 changed files with 88 additions and 15 deletions

View File

@@ -35,6 +35,12 @@ def configure_logging(
Returns:
The configured Logger instance.
Example:
from fastapi_toolsets.logger import configure_logging
logger = configure_logging("DEBUG")
logger.info("Application started")
"""
formatter = logging.Formatter(fmt)
@@ -75,6 +81,13 @@ def get_logger(name: str | None = _SENTINEL) -> logging.Logger: # type: ignore[
Returns:
A Logger instance.
Example:
from fastapi_toolsets.logger import get_logger
logger = get_logger() # uses caller's __name__
logger = get_logger("myapp") # explicit name
logger = get_logger(None) # root logger
"""
if name is _SENTINEL:
name = sys._getframe(1).f_globals.get("__name__")