Formatted with Ruff

This commit is contained in:
Richard Bowman 2024-12-03 06:46:08 +00:00
parent 27aec769a2
commit 9fd8fc37f1
19 changed files with 680 additions and 392 deletions

View file

@ -4,9 +4,10 @@ import os
from fastapi.responses import FileResponse, PlainTextResponse
OFM_LOG_FOLDER = "/var/openflexure/logs/"
OFM_LOG_FOLDER = "/var/openflexure/logs/"
OFM_LOG_FILE = os.path.join(OFM_LOG_FOLDER, "openflexure_microscope.log")
def configure_logging():
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)
@ -14,15 +15,13 @@ def configure_logging():
if not os.path.exists(OFM_LOG_FOLDER):
os.makedirs(OFM_LOG_FOLDER)
handler = RotatingFileHandler(
filename = OFM_LOG_FILE,
mode = "a",
maxBytes = 1000000,
backupCount = 10,
filename=OFM_LOG_FILE,
mode="a",
maxBytes=1000000,
backupCount=10,
)
handler.setFormatter(
logging.Formatter(
"[%(asctime)s] [%(levelname)s] %(message)s"
)
logging.Formatter("[%(asctime)s] [%(levelname)s] %(message)s")
)
root_logger.addHandler(handler)
except PermissionError as e: