Changed the log formatting a bit, added file and function name and line

numbers to the log string.
This commit is contained in:
maor.rayzin 2018-05-31 13:18:33 +03:00
parent 05c4bb7ac7
commit 509558fbb2
2 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,7 @@
"disable_existing_loggers": false,
"formatters": {
"simple": {
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
"format": "%(asctime)s - %(filename)s:%(lineno)s - %(funcName)10s() - %(levelname)s - %(message)s"
}
},

View File

@ -1,3 +1,4 @@
import logging
from flask import request, jsonify
import flask_restful
@ -5,6 +6,8 @@ from cc.services.node import NodeService
__author__ = 'itay.mizeretz'
logger = logging.getLogger(__name__)
class ClientRun(flask_restful.Resource):
def get(self):
@ -17,6 +20,7 @@ class ClientRun(flask_restful.Resource):
if monkey is not None:
is_monkey_running = not monkey["dead"]
else:
logger.info("")
is_monkey_running = False
return jsonify(is_running=is_monkey_running)