log exceptions only in debug mode

This commit is contained in:
Ozzieisaacs
2020-12-11 16:46:02 +01:00
parent 8b605aeaa8
commit d9b22fd513
7 changed files with 44 additions and 12 deletions
+4 -1
View File
@@ -259,7 +259,10 @@ def delete_book(book_id, book_format, jsonResponse):
filter(db.Data.format == book_format).delete()
calibre_db.session.commit()
except Exception as e:
log.exception(e)
if config.config_log_level == logger.logging.DEBUG:
log.exception(e)
else:
log.error(e)
calibre_db.session.rollback()
else:
# book not found