diff options
author | dongwenjuan <dong.wenjuan@zte.com.cn> | 2016-09-20 17:56:28 +0800 |
---|---|---|
committer | dongwenjuan <dong.wenjuan@zte.com.cn> | 2016-12-01 12:03:43 +0800 |
commit | b7b37cfd508ca612c217e802b38b7a50d04e7e7e (patch) | |
tree | 0e1da516454affeeff292445959ba6f201adfa18 /tests/consumer.py | |
parent | 69264fa32e7885be44667efa34c0c58cc110f5b6 (diff) |
remove `Debug = True when run Flask and add logger
JIRA: DOCTOR-79
Change-Id: I9193ec387af3b593b8f19d8f4b72ddec5c759bc0
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'tests/consumer.py')
-rw-r--r-- | tests/consumer.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/consumer.py b/tests/consumer.py index 9b3230fe..3c012b4f 100644 --- a/tests/consumer.py +++ b/tests/consumer.py @@ -11,17 +11,20 @@ import argparse from flask import Flask from flask import request import json +import logger as doctor_log import os import time +LOG = doctor_log.Logger('doctor_consumer').getLogger() + app = Flask(__name__) @app.route('/failure', methods=['POST']) def event_posted(): - app.logger.debug('doctor consumer notified at %s' % time.time()) - app.logger.debug('received data = %s' % request.data) + LOG.info('doctor consumer notified at %s' % time.time()) + LOG.info('received data = %s' % request.data) d = json.loads(request.data) return "OK" @@ -35,7 +38,7 @@ def get_args(): def main(): args = get_args() - app.run(host="0.0.0.0", port=args.port, debug=True) + app.run(host="0.0.0.0", port=args.port) if __name__ == '__main__': |