mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
Dissables Flask logging
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import json
|
import json
|
||||||
from flask import Flask, request, Response, abort, jsonify
|
from flask import Flask, request, Response, abort, jsonify
|
||||||
|
|
||||||
@@ -11,6 +12,7 @@ from pisa.block_processor import BlockProcessor
|
|||||||
|
|
||||||
# ToDo: #5-add-async-to-api
|
# ToDo: #5-add-async-to-api
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
HTTP_OK = 200
|
HTTP_OK = 200
|
||||||
HTTP_BAD_REQUEST = 400
|
HTTP_BAD_REQUEST = 400
|
||||||
HTTP_SERVICE_UNAVAILABLE = 503
|
HTTP_SERVICE_UNAVAILABLE = 503
|
||||||
@@ -125,7 +127,8 @@ def start_api():
|
|||||||
watcher = Watcher()
|
watcher = Watcher()
|
||||||
inspector = Inspector()
|
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)
|
logging.getLogger('werkzeug').setLevel(logging.ERROR)
|
||||||
|
os.environ['WERKZEUG_RUN_MAIN'] = 'true'
|
||||||
|
|
||||||
app.run(host=HOST, port=PORT)
|
app.run(host=HOST, port=PORT)
|
||||||
|
|||||||
Reference in New Issue
Block a user