From 42b9ec819b7b7ab7c29b483952d9e75a7f13a8bd Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 28 Apr 2018 21:45:13 +0200 Subject: [PATCH] More verbose dbdict json loading logging --- src/Content/ContentDbDict.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Content/ContentDbDict.py b/src/Content/ContentDbDict.py index a707931b..b47a15a3 100644 --- a/src/Content/ContentDbDict.py +++ b/src/Content/ContentDbDict.py @@ -2,6 +2,9 @@ import time import os import ContentDb +from Debug import Debug +from Config import config + class ContentDbDict(dict): def __init__(self, site, *args, **kwargs): @@ -19,7 +22,10 @@ class ContentDbDict(dict): try: self.num_loaded += 1 if self.num_loaded % 100 == 0: - self.log.debug("Loaded json: %s (latest: %s)" % (self.num_loaded, key)) + if config.verbose: + self.log.debug("Loaded json: %s (latest: %s) called by: %s" % (self.num_loaded, key, Debug.formatStack())) + else: + self.log.debug("Loaded json: %s (latest: %s)" % (self.num_loaded, key)) content = self.site.storage.loadJson(key) dict.__setitem__(self, key, content) except IOError: