Add more logging. Return json from get_data
This commit is contained in:
parent
398f432e1a
commit
a349a9f133
|
@ -17,7 +17,7 @@ class Daemon:
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
"Gets data from car api"
|
"Gets data from car api"
|
||||||
return requests.get(self.car_api)
|
return requests.get(self.car_api).json()
|
||||||
|
|
||||||
def emit(self, event, data):
|
def emit(self, event, data):
|
||||||
"Events data to OSD Backend"
|
"Events data to OSD Backend"
|
||||||
|
@ -25,13 +25,15 @@ class Daemon:
|
||||||
"event": event,
|
"event": event,
|
||||||
"data": data
|
"data": data
|
||||||
}
|
}
|
||||||
print(json)
|
logging.info("Emitting to OSD Frontend")
|
||||||
|
logging.debug("%s", json)
|
||||||
return requests.post(self.osd_backend, json=json)
|
return requests.post(self.osd_backend, json=json)
|
||||||
|
|
||||||
def check_all(self):
|
def check_all(self):
|
||||||
"Checks all the plugins"
|
"Checks all the plugins"
|
||||||
data = self.get_data()
|
data = self.get_data()
|
||||||
for plugin in self.plugins:
|
for plugin in self.plugins:
|
||||||
|
logging.debug("Checking plugin %s", plugin)
|
||||||
try:
|
try:
|
||||||
plugin.check(data)
|
plugin.check(data)
|
||||||
except Exception as error: # pylint: disable=broad-except
|
except Exception as error: # pylint: disable=broad-except
|
||||||
|
|
Loading…
Reference in New Issue