Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,11 @@ check-all: lint test-all coverage ## Run all linting, tests, a
# =============================================================================
# Docs
# =============================================================================
# XXX: docs commands are pinned to Python 3.12 due to picologging not being compatible with 3.13

.PHONY: docs-install
docs-install: ## Install docs dependencies
@echo "=> Installing documentation dependencies"
@uv sync --python 3.12 --group docs
@uv sync --group docs
@echo "=> Installed documentation dependencies"

docs-clean: ## Dump the existing built docs
Expand All @@ -136,16 +135,16 @@ docs-clean: ## Dump the existing built docs

docs-serve: ## Serve the docs locally
@echo "=> Serving documentation"
uv run --isolated --python 3.12 sphinx-autobuild docs docs/_build/ -j auto --watch litestar --watch docs --watch tests --watch CONTRIBUTING.rst --open-browser --port=0
uv run --isolated sphinx-autobuild docs docs/_build/ -j auto --watch litestar --watch docs --watch tests --watch CONTRIBUTING.rst --open-browser --port=0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider leaving these pins in.

When i install the dev env, I typically use the lowest supported version for the library (3.10 in this case), but the latest versions of Sphinx have a minimum version of 3.12. We have been running into similar problems with the Advanced Alchemy docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a reason for unpinning this but I can't remember. I'll find out


docs: docs-clean ## Dump the existing built docs and rebuild them
@echo "=> Building documentation"
@uv run --isolated --python 3.12 sphinx-build -M html docs docs/_build/ -E -a -j auto -W --keep-going
@uv run --isolated sphinx-build -M html docs docs/_build/ -E -a -j auto -W --keep-going

.PHONY: docs-linkcheck
docs-linkcheck: ## Run the link check on the docs
@uv run --isolated --python 3.12 sphinx-build -b linkcheck ./docs ./docs/_build -D linkcheck_ignore='http://.*','https://.*'
@uv run --isolated sphinx-build -b linkcheck ./docs ./docs/_build -D linkcheck_ignore='http://.*','https://.*'

.PHONY: docs-linkcheck-full
docs-linkcheck-full: ## Run the full link check on the docs
@uv run --isolated --python 3.12 sphinx-build -b linkcheck ./docs ./docs/_build -D linkcheck_anchors=0
@uv run --isolated sphinx-build -b linkcheck ./docs ./docs/_build -D linkcheck_anchors=0
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"alembic": ("https://alembic.sqlalchemy.org/en/latest/", None),
"click": ("https://click.palletsprojects.com/en/latest/", None),
"redis": ("https://redis.readthedocs.io/en/stable/", None),
"picologging": ("https://microsoft.github.io/picologging/", None),
"structlog": ("https://www.structlog.org/en/stable/", None),
"tortoise": ("https://tortoise.github.io/", None),
"piccolo": ("https://piccolo-orm.readthedocs.io/en/latest/", None),
Expand Down Expand Up @@ -261,6 +260,12 @@
re.compile(r"litestar\.channels\.backends\.asyncpg.*"): {"asyncpg.connection.Connection", "asyncpg.Connection"},
re.compile(r"litestar\.handlers\.websocket_handlers\.stream.*"): {"WebSocketMode"},
re.compile(r"litestar\.file_system.*"): {"AnyFileSystem", "SymlinkResolver"},
# these exist in struclog, but Sphinx thinks they're classes which they are not; they are type aliases
re.compile(r"litestar\.logging\.structlog\.StructLoggingConfig"): {
"structlog.typing.Processor",
"structlog.typing.Context",
"structlog.typing.WrappedLogger",
},
}

# Do not warn about broken links to the following:
Expand Down
14 changes: 8 additions & 6 deletions docs/examples/middleware/logging_middleware.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
from litestar import Litestar, get
from litestar.logging.config import LoggingConfig
from litestar.middleware.logging import LoggingMiddlewareConfig
from litestar.middleware.logging import LoggingMiddleware

logging_middleware_config = LoggingMiddlewareConfig()


@get("/", sync_to_thread=False)
def my_handler() -> dict[str, str]:
@get("/")
async def my_handler() -> dict[str, str]:
return {"hello": "world"}


app = Litestar(
route_handlers=[my_handler],
logging_config=LoggingConfig(),
middleware=[logging_middleware_config.middleware],
middleware=[
LoggingMiddleware(
request_log_fields=("query", "body"), # only log query and body fields
)
],
)
5 changes: 1 addition & 4 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ Installation
:doc:`RedisStore </usage/stores>`
:code:`pip install 'litestar[redis]'`

:ref:`Picologging <usage/logging:using picologging>`
:code:`pip install 'litestar[picologging]'`

:ref:`StructLog <usage/logging:using structlog>`
:ref:`StructLog <usage/logging:Structlog integration>`
:code:`pip install 'litestar[structlog]'`

:doc:`Prometheus Instrumentation </usage/metrics/prometheus>`
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/logging/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ logging
:titlesonly:

config
picologging
standard
structlog
5 changes: 0 additions & 5 deletions docs/reference/logging/picologging.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/reference/logging/standard.rst

This file was deleted.

5 changes: 5 additions & 0 deletions docs/reference/logging/structlog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
structlog
=========

.. automodule:: litestar.logging.structlog
:members:
1 change: 0 additions & 1 deletion docs/reference/plugins/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ plugins
problem_details
prometheus
pydantic
structlog
6 changes: 0 additions & 6 deletions docs/reference/plugins/structlog.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/release-notes/2.x-changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
:type: feature
:pr: 2969

The option :attr:`~litestar.logging.config.LoggingConfig.configure_root_logger` was
The option ``litestar.logging.config.LoggingConfig.configure_root_logger`` was
added to :class:`~litestar.logging.config.LoggingConfig` attribute. It is enabled by
default to not implement a breaking change.

Expand Down
4 changes: 2 additions & 2 deletions docs/release-notes/whats-new-2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ Imports
+----------------------------------------------------+------------------------------------------------------------------------+
| ``starlite.TemplateConfig`` | :class:`.template.TemplateConfig` |
+----------------------------------------------------+------------------------------------------------------------------------+
| ``starlite.BaseLoggingConfig`` | :class:`.logging.config.BaseLoggingConfig` |
| ``starlite.BaseLoggingConfig`` | ``litestar.logging.config.BaseLoggingConfig`` |
+----------------------------------------------------+------------------------------------------------------------------------+
| ``starlite.LoggingConfig`` | :class:`.logging.config.LoggingConfig` |
+----------------------------------------------------+------------------------------------------------------------------------+
| ``starlite.StructLoggingConfig`` | :class:`.logging.config.StructLoggingConfig` |
| ``starlite.StructLoggingConfig`` | ``litestar.logging.config.StructLoggingConfig`` |
+----------------------------------------------------+------------------------------------------------------------------------+
| **Provide** |
+----------------------------------------------------+------------------------------------------------------------------------+
Expand Down
Loading
Loading