Commit b5e21bc0 authored by Yannik Buch's avatar Yannik Buch
Browse files

Replaced various prints with logging

parent f3571373
......@@ -270,10 +270,10 @@ class elog():
else:
result = self.api_post('/api/v1/login', data={'user': self.usernameb2rc, 'password': self.passwordb2rc})
if not result:
print('Could not reach b2rc')
logging.warning('Could not reach b2rc login')
return False
if result.status_code != 200 or result.json()['status'] != 'success':
print('B2rc api: Invalid authentication')
logging.warning('B2rc api: Invalid authentication')
return False
self._resume = (token is not None)
self._b2rc_token = result.json()['data']['authToken']
......@@ -350,7 +350,7 @@ class elog():
result = self.api_post('/api/v1/chat.postMessage', data)
if not result:
print('Could not reach b2rc')
logging.warning('Could not reach b2rc login')
return False
return result.json()['success']
......@@ -372,13 +372,13 @@ class elog():
try:
html = self.search_elog()
except Exception as e:
logging.error('An exception occured ')
logging.error(traceback.format_exc())
continue
last_report_url = self.get_ref_from_html(html)
# TODO get time information and reference to uploaded report. Cant be sure that last report is this one
try:
self.postReport(last_report_url)
except Exception as e:
print('RocketChat: Sending shift report to b2rc failed: {}'.format(e))
logging.warning('RocketChat: Sending shift report to b2rc failed: {}'.format(e))
return False
return True
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment