Commit 3a62f823 authored by Vincent Pelletier's avatar Vincent Pelletier

Display caller's location in deprecation log message.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17548 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9e837039
...@@ -32,6 +32,7 @@ from AccessControl.SecurityInfo import allow_class ...@@ -32,6 +32,7 @@ from AccessControl.SecurityInfo import allow_class
from CachePlugins.BaseCache import CachedMethodError from CachePlugins.BaseCache import CachedMethodError
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from traceback import extract_stack
DEFAULT_CACHE_SCOPE = 'GLOBAL' DEFAULT_CACHE_SCOPE = 'GLOBAL'
DEFAULT_CACHE_FACTORY = 'erp5_ui_short' DEFAULT_CACHE_FACTORY = 'erp5_ui_short'
...@@ -264,7 +265,8 @@ def disableReadOnlyTransactionCache(context): ...@@ -264,7 +265,8 @@ def disableReadOnlyTransactionCache(context):
def clearCache(cache_factory_list=(DEFAULT_CACHE_FACTORY,)): def clearCache(cache_factory_list=(DEFAULT_CACHE_FACTORY,)):
"""Clear specified cache factory list.""" """Clear specified cache factory list."""
LOG("Cache.clearCache", \ filename, line, function, text = extract_stack(limit=2)[0]
LOG("%s:%i" % (filename, line), \
WARNING, \ WARNING, \
"Global function clearCache() is deprecated. Use portal_caches.clearCache() instead.") "Global function clearCache() is deprecated. Use portal_caches.clearCache() instead.")
cache_storage = CachingMethod.factories cache_storage = CachingMethod.factories
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment