More verbose dbdict json loading logging

This commit is contained in:
shortcutme 2018-04-28 21:45:13 +02:00
parent e93f9eb080
commit 42b9ec819b
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -2,6 +2,9 @@ import time
import os import os
import ContentDb import ContentDb
from Debug import Debug
from Config import config
class ContentDbDict(dict): class ContentDbDict(dict):
def __init__(self, site, *args, **kwargs): def __init__(self, site, *args, **kwargs):
@ -19,7 +22,10 @@ class ContentDbDict(dict):
try: try:
self.num_loaded += 1 self.num_loaded += 1
if self.num_loaded % 100 == 0: 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) content = self.site.storage.loadJson(key)
dict.__setitem__(self, key, content) dict.__setitem__(self, key, content)
except IOError: except IOError: