[Erp5-report] r17548 - /erp5/trunk/products/ERP5Type/Cache.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 13 09:42:40 CET 2007


Author: vincent
Date: Tue Nov 13 09:42:40 2007
New Revision: 17548

URL: http://svn.erp5.org?rev=17548&view=rev
Log:
Display caller's location in deprecation log message.

Modified:
    erp5/trunk/products/ERP5Type/Cache.py

Modified: erp5/trunk/products/ERP5Type/Cache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Cache.py?rev=17548&r1=17547&r2=17548&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Cache.py (original)
+++ erp5/trunk/products/ERP5Type/Cache.py Tue Nov 13 09:42:40 2007
@@ -32,6 +32,7 @@
 from CachePlugins.BaseCache import CachedMethodError
 from zLOG import LOG, WARNING
 from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
+from traceback import extract_stack
 
 DEFAULT_CACHE_SCOPE = 'GLOBAL'
 DEFAULT_CACHE_FACTORY = 'erp5_ui_short'
@@ -264,7 +265,8 @@
 
 def clearCache(cache_factory_list=(DEFAULT_CACHE_FACTORY,)):
   """Clear specified cache factory list."""
-  LOG("Cache.clearCache", \
+  filename, line, function, text = extract_stack(limit=2)[0]
+  LOG("%s:%i" % (filename, line), \
       WARNING, \
       "Global function clearCache() is deprecated. Use portal_caches.clearCache() instead.")
   cache_storage = CachingMethod.factories




More information about the Erp5-report mailing list