Add public method docstrings.

This commit is contained in:
Julian Stirling 2025-07-10 15:12:28 +01:00
parent 1bbbfeef0f
commit 14359e73bb
8 changed files with 58 additions and 8 deletions

View file

@ -21,6 +21,14 @@ OFM_LOG_FILE = None
def configure_logging(log_folder):
"""Configure logging for the server while it is running.
This modifies the root logger to have a rotating file handler and
adds a custom handler that prints and stores all records except
``uvicorn.access`` logs.
It is important not to let Uvicorn override these settings.
"""
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)
# Explictly make OFM_LOG_FILE a global so it can be updated based on log settings

View file

@ -6,6 +6,7 @@ from socket import gethostname
def add_v2_endpoints(thing_server: lt.ThingServer):
"""Add the v2 API endpoints for OpenFlexure Connect discoverability."""
app = thing_server.app
# TODO: update openflexure connect to make this unnecessary!!

View file

@ -14,6 +14,7 @@ import labthings_fastapi as lt
def thing_server_from_request(request: Request) -> lt.ThingServer:
"""Wrap lt.find_thing_server."""
return lt.find_thing_server(request.app)