mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Changed log format to JSON; fixed missing return value in get_potential_matches
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
from flask import Flask, request, Response, abort, jsonify
|
||||
|
||||
from pisa import HOST, PORT, logging, bitcoin_cli, M
|
||||
from pisa.watcher import Watcher
|
||||
from pisa.inspector import Inspector
|
||||
from pisa import HOST, PORT, logging
|
||||
@@ -20,7 +21,7 @@ def add_appointment():
|
||||
remote_addr = request.environ.get('REMOTE_ADDR')
|
||||
remote_port = request.environ.get('REMOTE_PORT')
|
||||
|
||||
logging.info('[API] connection accepted from {}:{}'.format(remote_addr, remote_port))
|
||||
logging.info(M('[API] connection accepted', from_addr_port='{}:{}'.format(remote_addr, remote_port)))
|
||||
|
||||
# Check content type once if properly defined
|
||||
request_data = json.loads(request.get_json())
|
||||
@@ -46,7 +47,7 @@ def add_appointment():
|
||||
rcode = HTTP_BAD_REQUEST
|
||||
response = "appointment rejected. Request does not match the standard"
|
||||
|
||||
logging.info('[API] sending response and disconnecting: {} --> {}:{}'.format(response, remote_addr, remote_port))
|
||||
logging.info(M('[API] sending response and disconnecting', from_addr_port='{}:{}'.format(remote_addr, remote_port), response=response))
|
||||
|
||||
return Response(response, status=rcode, mimetype='text/plain')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user