mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-04 18:40:51 +02:00
Add bit more diag output.
This commit is contained in:
parent
d6684663bb
commit
4d1326c1bb
3 changed files with 15 additions and 13 deletions
|
|
@ -21,18 +21,18 @@ logger = logging.getLogger(__name__)
|
|||
# profile.print_stats()
|
||||
# return profiled_func
|
||||
|
||||
# import time
|
||||
# def do_cprofile(func):
|
||||
# def profiled_func(*args, **kwargs):
|
||||
# t=0
|
||||
# try:
|
||||
# t = time.time()
|
||||
# result = func(*args, **kwargs)
|
||||
# t = time.time() - t
|
||||
# return result
|
||||
# finally:
|
||||
# logger.debug("do_cprofile time:%s"%t)
|
||||
# return profiled_func
|
||||
import time
|
||||
def do_cprofile(func):
|
||||
def profiled_func(*args, **kwargs):
|
||||
t=0
|
||||
try:
|
||||
t = time.time()
|
||||
result = func(*args, **kwargs)
|
||||
t = time.time() - t
|
||||
return result
|
||||
finally:
|
||||
logger.debug("do_cprofile time:%s"%t)
|
||||
return profiled_func
|
||||
|
||||
|
||||
class BrowserCache(object):
|
||||
|
|
@ -54,7 +54,7 @@ class BrowserCache(object):
|
|||
if autoload:
|
||||
self.do_map_cache_keys()
|
||||
|
||||
# @do_cprofile
|
||||
@do_cprofile
|
||||
def do_map_cache_keys(self,autoload=True):
|
||||
logger.debug("do_map_cache_keys()")
|
||||
self.browser_cache.map_cache_keys()
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class BlockfileCache(BaseBrowserCache):
|
|||
# Checking type
|
||||
if self.cacheBlock.type != CacheBlock.INDEX:
|
||||
raise Exception("Invalid Index File")
|
||||
logger.debug("Using BlockfileCache")
|
||||
|
||||
@staticmethod
|
||||
def is_cache_dir(cache_dir):
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class SimpleCache(BaseBrowserCache):
|
|||
def __init__(self, cache_dir):
|
||||
"""Constructor for SimpleCache"""
|
||||
BaseBrowserCache.__init__(self,cache_dir)
|
||||
logger.debug("Using BlockfileCache")
|
||||
|
||||
@staticmethod
|
||||
def is_cache_dir(cache_dir):
|
||||
|
|
|
|||
Loading…
Reference in a new issue