added option to disable logging

This commit is contained in:
Joel 2021-01-28 14:21:30 +01:00
parent e02b42060b
commit acc91cdd74
No known key found for this signature in database
GPG key ID: BDDDBECD0808290E
3 changed files with 32 additions and 17 deletions

View file

@ -1,7 +1,9 @@
import os
import threading
import cv2
import logging
import threading
import LogstashLogging
from flask import Flask, Response
RTMP_SERVER = os.getenv("RTMP_SERVER", "rtmp://localhost/live/stream")
@ -49,6 +51,7 @@ class __Streaming:
# self.__camera_stream = cv2.VideoCapture(0)
self.__newest_frame = None
self.__lock = threading.Lock()
logging.info("Initialized vision")
def get_frame(self):
"""
@ -101,6 +104,7 @@ Streaming = None
if BUILDING_DOCS == "false":
# instantiate private class __Streaming
Streaming = __Streaming()
logging.info("created instance of streaming class")
@app.route("/live")
@ -130,6 +134,7 @@ def __start_flask():
:return:
"""
logging.info("starting flask server")
app.run(host="0.0.0.0", port=9898, debug=True, threaded=True, use_reloader=False)