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
1 changed files with 7 additions and 1 deletions

View File

@ -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: