Commit 2e062e44 authored by Andreas Jung's avatar Andreas Jung

zLOG -> logging

parent 59a14865
......@@ -18,8 +18,8 @@ Zope object encapsulating a Page Template from the filesystem.
__version__ = '$Revision: 1.30 $'[11:-2]
import os, AccessControl
from logging import getLogger
from Globals import package_home, DevelopmentMode
from zLOG import LOG, ERROR
from Shared.DC.Scripts.Script import Script
from Shared.DC.Scripts.Signature import FuncCode
from AccessControl import getSecurityManager
......@@ -31,6 +31,9 @@ from Acquisition import aq_parent, aq_inner
from App.config import getConfiguration
from OFS.SimpleItem import Item_w__name__
LOG = getLogger('PageTemplateFile')
class PageTemplateFile(Item_w__name__, Script, PageTemplate, Traversable):
"Zope wrapper for filesystem Page Template using TAL, TALES, and METAL"
......@@ -146,8 +149,7 @@ class PageTemplateFile(Item_w__name__, Script, PageTemplate, Traversable):
self.pt_edit(text, t)
self._cook()
if self._v_errors:
LOG('PageTemplateFile', ERROR, 'Error in template',
'\n'.join(self._v_errors))
LOG.error('Error in template %s' % '\n'.join(self._v_errors))
return
self._v_last_read = mtime
......
......@@ -20,7 +20,6 @@ __version__='$Revision: 1.48 $'[11:-2]
import os, AccessControl, Acquisition, sys, types
from types import StringType
from Globals import DTMLFile, ImageFile, MessageDialog, package_home
from zLOG import LOG, ERROR, INFO
from OFS.SimpleItem import SimpleItem
from DateTime.DateTime import DateTime
from Shared.DC.Scripts.Script import Script, BindingsUI
......@@ -38,14 +37,7 @@ from PageTemplate import PageTemplate
from Expressions import SecureModuleImporter
from PageTemplateFile import PageTemplateFile
try:
from webdav.Lockable import ResourceLockedError
from webdav.WriteLockInterface import WriteLockInterface
SUPPORTS_WEBDAV_LOCKS = 1
except ImportError:
SUPPORTS_WEBDAV_LOCKS = 0
SUPPORTS_WEBDAV_LOCKS = 1
class Src(Acquisition.Explicit):
" "
......
......@@ -12,6 +12,7 @@
############################################################################
import re, time, sys
from logging import getLogger
import Globals
from OFS.SimpleItem import Item
from Acquisition import Implicit, Explicit, aq_base
......@@ -19,7 +20,6 @@ from Persistence import Persistent
from AccessControl.Owned import Owned
from AccessControl.Role import RoleManager
from App.Management import Tabs
from zLOG import LOG, WARNING, BLATHER
from AccessControl import ClassSecurityInfo
import SessionInterfaces
from SessionPermissions import *
......@@ -30,6 +30,7 @@ from ZPublisher.BeforeTraverse import registerBeforeTraverse, \
unregisterBeforeTraverse
bad_path_chars_in=re.compile('[^a-zA-Z0-9-_~\,\. \/]').search
LOG = getLogger('SessionDataManager')
class SessionDataManagerErr(Exception): pass
......@@ -205,7 +206,7 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs):
transactions for mounted storages. """
if self.obpath is None:
err = 'Session data container is unspecified in %s' % self.getId()
LOG('Session Tracking', WARNING, err)
LOG.warn(err)
raise SessionIdManagerErr, err
try:
# This should arguably use restrictedTraverse, but it
......@@ -215,8 +216,7 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs):
# hasattr hides conflicts
if DEBUG and not getattr(self, '_v_wrote_dc_type', None):
args = '/'.join(self.obpath)
LOG('Session Tracking', BLATHER,
'External data container at %s in use' % args)
LOG.debug('External data container at %s in use' % args)
self._v_wrote_dc_type = 1
return self.unrestrictedTraverse(self.obpath)
except:
......@@ -281,7 +281,7 @@ class SessionDataManagerTraverser(Persistent):
getSessionData = sdm.getSessionData
except:
msg = 'Session automatic traversal failed to get session data'
LOG('Session Tracking', WARNING, msg, error=sys.exc_info())
LOG.warn(msg, exc_info=sys.exc_info())
return
# set the getSessionData method in the "lazy" namespace
......
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