Dissables Flask logging

This commit is contained in:
Sergi Delgado Segura
2019-10-21 16:53:29 +01:00
parent d1d9693435
commit e5013d5bca

View File

@@ -1,3 +1,4 @@
import os
import json
from flask import Flask, request, Response, abort, jsonify
@@ -11,6 +12,7 @@ from pisa.block_processor import BlockProcessor
# ToDo: #5-add-async-to-api
app = Flask(__name__)
HTTP_OK = 200
HTTP_BAD_REQUEST = 400
HTTP_SERVICE_UNAVAILABLE = 503
@@ -125,7 +127,8 @@ def start_api():
watcher = Watcher()
inspector = Inspector()
# Setting Flask log t ERROR only so it does not mess with out logging
# Setting Flask log to ERROR only so it does not mess with out logging. Also disabling flask initial messages
logging.getLogger('werkzeug').setLevel(logging.ERROR)
os.environ['WERKZEUG_RUN_MAIN'] = 'true'
app.run(host=HOST, port=PORT)