From cd5fa5c1ffb2e49acfbeb74aac4847d2d8631acd Mon Sep 17 00:00:00 2001 From: kulath Date: Sun, 12 Jun 2016 12:46:40 +0100 Subject: [PATCH] Fix DBLOGNAME (".Db") diagnostics for database class instance --- gramps/gen/dbstate.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gramps/gen/dbstate.py b/gramps/gen/dbstate.py index 124b00097..07ac5229b 100644 --- a/gramps/gen/dbstate.py +++ b/gramps/gen/dbstate.py @@ -184,8 +184,15 @@ class DbState(Callback): self.save_modules() mod = pmgr.load_plugin(pdata) database = getattr(mod, pdata.databaseclass) - _LOG.debug("make_database %s" % database) - return database() + db = database() + import inspect + caller_frame = inspect.stack()[1] + _LOG.debug("Database class instance created Class:%s instance:%s. " + "Called from File %s, line %s, in %s" + % ((db.__class__.__name__, hex(id(db))) + + (os.path.split(caller_frame[1])[1],) + + tuple(caller_frame[i] for i in range(2, 4)))) + return db def open_database(self, dbname, force_unlock=False, callback=None): """