From 30b8dea53f528d3cd90bb277a7285399bb5bbffe Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sat, 22 Nov 2014 17:42:35 +0100 Subject: logging --- imdb-lookup/imdbinfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'imdb-lookup') diff --git a/imdb-lookup/imdbinfo.py b/imdb-lookup/imdbinfo.py index b41ff62..bc9a062 100755 --- a/imdb-lookup/imdbinfo.py +++ b/imdb-lookup/imdbinfo.py @@ -34,12 +34,14 @@ def read_key(): class TMDBCache(object): def __enter__(self): + self.logger = logging.getLogger(self.__class__.__module__ + "." + self.__class__.__name__) + self.logger.info("Open db") self.db = dbm.open(self._get_db_filename("tmdbmovie.dbm"),"c") self.db_images = dbm.open(self._get_db_filename("tmdbposter.dbm"), "c") - self.logger = logging.getLogger(self.__class__.__module__ + "." + self.__class__.__name__) return self def __exit__(self, type, value, traceback): + self.logger.info("Close db") self.db.close() self.db_images.close() -- cgit v1.2.1