class documentation

class OFMLogFileFormatter(logging.Formatter): (source)

View In Hierarchy

The formatter used for the OpenFlexure Microscope Server log file.

Method format Adjust the logging formatting for uvicorn logs.
def format(self, record: logging.LogRecord) -> str: (source) ΒΆ

Adjust the logging formatting for uvicorn logs.

uvicorn has two loggers. Each API access is uvicorn.access which we filter due to the noise. The other is uvicorn.error for more important messages. However, uvicorn.error is used for expected messages that are not errors, such as server start up. This can lead to people erroneously thinking that there is an error with their miroscope.