Cumulocity-IoT / cumulocity-devicemanagement-agent

Cumulocity Reference Agent written in Python to demonstrate most of the Device Management Capabilities of Cumulocity IoT
Apache License 2.0
26 stars 20 forks source link

Review Log Module #29

Closed elielias closed 3 years ago

elielias commented 3 years ago

The LogHandler Module needs to be reviewed

switschel commented 3 years ago

I would suggest to use logger instead of "print" E.g. line 68 in logfile_handler.py print('\n deviceid: {}\n starttime: {}\n endtime: {}\n searchtext:{}\n maximumlines:{} \n'.format(deviceid, starttime, endtime, searchtext, maximumlines))

switschel commented 3 years ago

Add Exception Handling try - except in handleOperation In case of error set the Operation to failed.

switschel commented 3 years ago

Line 131: binaryurl = self.agent.rest_client.upload_binary_logfile(internal_id, payload, file) function upload_binary_logfile does not exist in main branch.

elielias commented 3 years ago

Line 131: binaryurl = self.agent.rest_client.upload_binary_logfile(internal_id, payload, file) function upload_binary_logfile does not exist in main branch.

function is pushed now