mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-03-02 01:10:47 +01:00
chore: documentation (#76)
* chore: update docstring example to use python code block * docs: add documentation * feat: add docs build + fix other workdlows * fix: add missing return type
This commit is contained in:
@@ -37,10 +37,12 @@ def configure_logging(
|
||||
The configured Logger instance.
|
||||
|
||||
Example:
|
||||
```python
|
||||
from fastapi_toolsets.logger import configure_logging
|
||||
|
||||
logger = configure_logging("DEBUG")
|
||||
logger.info("Application started")
|
||||
```
|
||||
"""
|
||||
formatter = logging.Formatter(fmt)
|
||||
|
||||
@@ -83,11 +85,13 @@ def get_logger(name: str | None = _SENTINEL) -> logging.Logger: # type: ignore[
|
||||
A Logger instance.
|
||||
|
||||
Example:
|
||||
```python
|
||||
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__")
|
||||
|
||||
Reference in New Issue
Block a user