Enable logging

`logging.basicConfig` doesn't work when run via `uvicorn`.
I now explicitly get the root logger and set its level to INFO,
which means we now see logs on the terminal.
This commit is contained in:
Richard Bowman 2023-12-13 00:51:41 +00:00
parent 94e1619056
commit 3059683186

View file

@ -14,9 +14,11 @@ from .things.camera_stage_mapping import CameraStageMapper
from .things.system_control import SystemControlThing
from .things.settings_manager import SettingsManager
from .serve_static_files import add_static_files
import openflexure_microscope_server
logging.basicConfig(level=logging.INFO)
root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)
root_logger.info("This is a message from OFM server via root_logger")
logging.info("This is another message via logging.info")
thing_server = ThingServer()
thing_server.add_thing(StreamingPiCamera2(), "/camera/")