From a9cedb3fca226a40166a8696251cf24886d7abc6 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 23 Jan 2021 13:35:30 +0100 Subject: [PATCH] Add logger to db.py --- cps/db.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cps/db.py b/cps/db.py index ea865f80..c08a3ea4 100644 --- a/cps/db.py +++ b/cps/db.py @@ -50,6 +50,8 @@ try: except ImportError: use_unidecode = False +log = logger.create() + cc_exceptions = ['datetime', 'comments', 'composite', 'series'] cc_classes = {} @@ -627,9 +629,9 @@ class CalibreDB(): len(query.all())) entries = query.order_by(*order).offset(off).limit(pagesize).all() except Exception as e: - logger.debug(e) - for book in entries: - book = self.order_authors(book) + log.debug_or_exception(e) + #for book in entries: + # book = self.order_authors(book) return entries, randm, pagination # Orders all Authors in the list according to authors sort