Fixed PIL debug spam
This commit is contained in:
parent
a3716cf817
commit
83391f7edf
3 changed files with 10 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ if (__name__ == "__main__") or (not is_gunicorn):
|
||||||
# If imported, but not by gunicorn
|
# If imported, but not by gunicorn
|
||||||
print("Letting sys handle logs")
|
print("Letting sys handle logs")
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.DEBUG)
|
||||||
else:
|
else:
|
||||||
# Direct standard Python logging to file and console
|
# Direct standard Python logging to file and console
|
||||||
root = logging.getLogger()
|
root = logging.getLogger()
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ def plugins_representation(plugin_loader_object: PluginLoader):
|
||||||
plugins = []
|
plugins = []
|
||||||
|
|
||||||
for plugin in plugin_loader_object.active:
|
for plugin in plugin_loader_object.active:
|
||||||
logging.info(f"Representing plugin {plugin._name}")
|
logging.debug(f"Representing plugin {plugin._name}")
|
||||||
d = {
|
d = {
|
||||||
"name": plugin._name,
|
"name": plugin._name,
|
||||||
"plugin": str(plugin),
|
"plugin": str(plugin),
|
||||||
|
|
@ -31,7 +31,7 @@ def plugins_representation(plugin_loader_object: PluginLoader):
|
||||||
}
|
}
|
||||||
|
|
||||||
for view_id, view in plugin.views.items():
|
for view_id, view in plugin.views.items():
|
||||||
logging.info(f"Representing view {view_id}")
|
logging.debug(f"Representing view {view_id}")
|
||||||
uri = url_for(f"v2_plugins_blueprint.{view_id}")
|
uri = url_for(f"v2_plugins_blueprint.{view_id}")
|
||||||
# Make links dictionary if it doesn't yet exist
|
# Make links dictionary if it doesn't yet exist
|
||||||
view_d = {
|
view_d = {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,13 @@ from typing import Tuple
|
||||||
from openflexure_microscope.camera.base import BaseCamera
|
from openflexure_microscope.camera.base import BaseCamera
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
PIL spams the logger with debug-level information. This is a pain when debugging api.app.
|
||||||
|
We override the logging settings in api.app by setting a level for PIL here.
|
||||||
|
"""
|
||||||
|
pil_logger = logging.getLogger('PIL')
|
||||||
|
pil_logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
# MAIN CLASS
|
# MAIN CLASS
|
||||||
class MockStreamer(BaseCamera):
|
class MockStreamer(BaseCamera):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue