[CMF-checkins] SVN: CMF/branches/1.6/CMFCore/ Use logger.exception
convenience method.
Florent Guillaume
fg at nuxeo.com
Thu Jun 8 12:54:49 EDT 2006
Log message for revision 68524:
Use logger.exception convenience method.
Changed:
U CMF/branches/1.6/CMFCore/DirectoryView.py
U CMF/branches/1.6/CMFCore/FSMetadata.py
U CMF/branches/1.6/CMFCore/Skinnable.py
U CMF/branches/1.6/CMFCore/TypesTool.py
-=-
Modified: CMF/branches/1.6/CMFCore/DirectoryView.py
===================================================================
--- CMF/branches/1.6/CMFCore/DirectoryView.py 2006-06-08 16:23:41 UTC (rev 68523)
+++ CMF/branches/1.6/CMFCore/DirectoryView.py 2006-06-08 16:54:49 UTC (rev 68524)
@@ -155,8 +155,7 @@
path.walk(self._filepath, self._walker, filelist)
filelist.sort()
except:
- logger.error("Error checking for directory modification",
- exc_info=True)
+ logger.exception("Error checking for directory modification")
if mtime != self._v_last_read or filelist != self._v_last_filelist:
self._v_last_read = mtime
@@ -178,7 +177,7 @@
self.data, self.objects = self.prepareContents(registry,
register_subdirs=changed)
except:
- logger.error("Error during prepareContents", exc_info=True)
+ logger.exception("Error during prepareContents")
self.data = {}
self.objects = ()
@@ -247,11 +246,11 @@
import traceback
typ, val, tb = exc_info()
try:
+ logger.exception("prepareContents")
+
exc_lines = traceback.format_exception( typ,
val,
tb )
- logger.error('\n'.join(exc_lines))
-
ob = BadFile( name,
entry_minimal_fp,
exc_str='\r\n'.join(exc_lines),
@@ -267,16 +266,14 @@
try:
ob.manage_permission(name,roles,acquire)
except ValueError:
- logger.error("Error setting permissions",
- exc_info=True)
+ logger.exception("Error setting permissions")
# only DTML Methods and Python Scripts can have proxy roles
if hasattr(ob, '_proxy_roles'):
try:
ob._proxy_roles = tuple(metadata.getProxyRoles())
except:
- logger.error("Error setting proxy role",
- exc_info=True)
+ logger.exception("Error setting proxy role")
ob_id = ob.getId()
data[ob_id] = ob
Modified: CMF/branches/1.6/CMFCore/FSMetadata.py
===================================================================
--- CMF/branches/1.6/CMFCore/FSMetadata.py 2006-06-08 16:23:41 UTC (rev 68523)
+++ CMF/branches/1.6/CMFCore/FSMetadata.py 2006-06-08 16:54:49 UTC (rev 68524)
@@ -93,7 +93,7 @@
self._security = self._getSectionDict(cfg, 'security',
self._securityParser)
except:
- logger.error("Error parsing .metadata file", exc_info=True)
+ logger.exception("Error parsing .metadata file")
# to add in a new value such as proxy roles,
# just add in the section, call it using getSectionDict
@@ -169,8 +169,7 @@
if len(kv) == 2:
props[kv[0].strip()] = kv[1].strip()
else:
- logger.error("Error parsing .properties file",
- exc_info=True)
+ logger.exception("Error parsing .properties file")
return props
@@ -205,7 +204,7 @@
if role:
roles.append(role)
except:
- logger.error("Error reading permission from .security file",
- exc_info=True)
+ logger.exception("Error reading permission "
+ "from .security file")
prm[permission]=(acquire,roles)
return prm
Modified: CMF/branches/1.6/CMFCore/Skinnable.py
===================================================================
--- CMF/branches/1.6/CMFCore/Skinnable.py 2006-06-08 16:23:41 UTC (rev 68523)
+++ CMF/branches/1.6/CMFCore/Skinnable.py 2006-06-08 16:54:49 UTC (rev 68524)
@@ -193,7 +193,7 @@
except:
# This shouldn't happen, even if the requested skin
# does not exist.
- logger.error("Unable to setupCurrentSkin()", exc_info=True)
+ logger.exception("Unable to setupCurrentSkin()")
return w_self
def _checkId(self, id, allow_dup=0):
Modified: CMF/branches/1.6/CMFCore/TypesTool.py
===================================================================
--- CMF/branches/1.6/CMFCore/TypesTool.py 2006-06-08 16:23:41 UTC (rev 68523)
+++ CMF/branches/1.6/CMFCore/TypesTool.py 2006-06-08 16:54:49 UTC (rev 68524)
@@ -526,8 +526,7 @@
try:
p = dispatcher[self.product]
except AttributeError:
- logger.error("_queryFactoryMethod raised an exception",
- exc_info=True)
+ logger.exception("_queryFactoryMethod raised an exception")
return default
m = getattr(p, self.factory, None)
More information about the CMF-checkins
mailing list