Rewrite logger

This commit is contained in:
Kiryl
2021-11-30 16:00:28 +03:00
parent f69c638640
commit 2e5f666777
4 changed files with 9 additions and 8 deletions

View File

@@ -144,10 +144,11 @@ class BookSolver:
without downloading book from server (local)
with sending to server'''
try:
self.logger_object.log(f'Data has been downloaded from tmp.json file: {self.output_path}')
self.logger_object.log(f'Data has been downloaded from tmp.json file: {self.file_path}')
with codecs.open('json/tmp.json', 'r', encoding='utf-8') as f_json:
content_dict = json.load(f_json)
self.send_json_content_to_server(content_dict)
self.logger_object.log(f'End of the conversion to LiveCarta format. Check {self.output_path}.')
except Exception as exc:
self.logger_object.log('Error has occurred while reading json file.' + str(exc), logging.ERROR)