Commit e5072ff7 authored by Tres Seaver's avatar Tres Seaver

Test run without zLOG deprecation warnings.

parent 56062e87
...@@ -17,6 +17,7 @@ $Id: BTreeFolder2.py,v 1.27 2004/03/17 22:49:25 urbanape Exp $ ...@@ -17,6 +17,7 @@ $Id: BTreeFolder2.py,v 1.27 2004/03/17 22:49:25 urbanape Exp $
""" """
import sys import sys
import logging
from cgi import escape from cgi import escape
from urllib import quote from urllib import quote
from random import randint from random import randint
...@@ -35,7 +36,6 @@ from OFS.Folder import Folder ...@@ -35,7 +36,6 @@ from OFS.Folder import Folder
from AccessControl import getSecurityManager, ClassSecurityInfo from AccessControl import getSecurityManager, ClassSecurityInfo
from AccessControl.Permissions import access_contents_information, \ from AccessControl.Permissions import access_contents_information, \
view_management_screens view_management_screens
from zLOG import LOG, INFO, ERROR, WARNING
from Products.ZCatalog.Lazy import LazyMap from Products.ZCatalog.Lazy import LazyMap
from zope.event import notify from zope.event import notify
from zope.app.container.contained import ObjectAddedEvent from zope.app.container.contained import ObjectAddedEvent
...@@ -45,6 +45,7 @@ from OFS.event import ObjectWillBeAddedEvent ...@@ -45,6 +45,7 @@ from OFS.event import ObjectWillBeAddedEvent
from OFS.event import ObjectWillBeRemovedEvent from OFS.event import ObjectWillBeRemovedEvent
import OFS.subscribers import OFS.subscribers
LOG = logging.getLogger('BTreeFolder2')
manage_addBTreeFolderForm = DTMLFile('folderAdd', globals()) manage_addBTreeFolderForm = DTMLFile('folderAdd', globals())
...@@ -191,8 +192,7 @@ class BTreeFolder2Base (Persistent): ...@@ -191,8 +192,7 @@ class BTreeFolder2Base (Persistent):
% repr(key)) % repr(key))
return 1 return 1
except AssertionError: except AssertionError:
LOG('BTreeFolder2', WARNING, LOG.warn( 'Detected damage to %s. Fixing now.' % path,
'Detected damage to %s. Fixing now.' % path,
error=sys.exc_info()) error=sys.exc_info())
try: try:
self._tree = OOBTree(self._tree) self._tree = OOBTree(self._tree)
...@@ -201,11 +201,11 @@ class BTreeFolder2Base (Persistent): ...@@ -201,11 +201,11 @@ class BTreeFolder2Base (Persistent):
mt_index[key] = OIBTree(value) mt_index[key] = OIBTree(value)
self._mt_index = mt_index self._mt_index = mt_index
except: except:
LOG('BTreeFolder2', ERROR, 'Failed to fix %s.' % path, LOG.error('Failed to fix %s.' % path,
error=sys.exc_info()) error=sys.exc_info())
raise raise
else: else:
LOG('BTreeFolder2', INFO, 'Fixed %s.' % path) LOG.info('Fixed %s.' % path)
return 0 return 0
......
...@@ -18,8 +18,9 @@ Zope object encapsulating a Page Template from the filesystem. ...@@ -18,8 +18,9 @@ Zope object encapsulating a Page Template from the filesystem.
__version__ = '$Revision: 1.30 $'[11:-2] __version__ = '$Revision: 1.30 $'[11:-2]
import os, AccessControl import os, AccessControl
import logging
from Globals import package_home, DevelopmentMode from Globals import package_home, DevelopmentMode
from zLOG import LOG, ERROR
from Shared.DC.Scripts.Script import Script from Shared.DC.Scripts.Script import Script
from Shared.DC.Scripts.Signature import FuncCode from Shared.DC.Scripts.Signature import FuncCode
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
...@@ -31,6 +32,8 @@ from Acquisition import aq_parent, aq_inner ...@@ -31,6 +32,8 @@ from Acquisition import aq_parent, aq_inner
from App.config import getConfiguration from App.config import getConfiguration
from OFS.SimpleItem import Item_w__name__ from OFS.SimpleItem import Item_w__name__
LOG = logging.getLogger('PageTemplateFile')
class PageTemplateFile(Item_w__name__, Script, PageTemplate, Traversable): class PageTemplateFile(Item_w__name__, Script, PageTemplate, Traversable):
"Zope wrapper for filesystem Page Template using TAL, TALES, and METAL" "Zope wrapper for filesystem Page Template using TAL, TALES, and METAL"
...@@ -146,8 +149,7 @@ class PageTemplateFile(Item_w__name__, Script, PageTemplate, Traversable): ...@@ -146,8 +149,7 @@ class PageTemplateFile(Item_w__name__, Script, PageTemplate, Traversable):
self.pt_edit(text, t) self.pt_edit(text, t)
self._cook() self._cook()
if self._v_errors: if self._v_errors:
LOG('PageTemplateFile', ERROR, 'Error in template', LOG.error('Error in template', '\n'.join(self._v_errors))
'\n'.join(self._v_errors))
return return
self._v_last_read = mtime self._v_last_read = mtime
......
...@@ -20,6 +20,7 @@ Python code. ...@@ -20,6 +20,7 @@ Python code.
__version__='$Revision: 1.56 $'[11:-2] __version__='$Revision: 1.56 $'[11:-2]
import sys, os, traceback, re, marshal, new import sys, os, traceback, re, marshal, new
import logging
from Globals import DTMLFile, MessageDialog, package_home from Globals import DTMLFile, MessageDialog, package_home
import AccessControl, OFS, RestrictedPython import AccessControl, OFS, RestrictedPython
from Acquisition import aq_parent from Acquisition import aq_parent
...@@ -33,10 +34,11 @@ from AccessControl import getSecurityManager ...@@ -33,10 +34,11 @@ from AccessControl import getSecurityManager
from OFS.History import Historical, html_diff from OFS.History import Historical, html_diff
from OFS.Cache import Cacheable from OFS.Cache import Cacheable
from AccessControl.ZopeGuards import get_safe_globals, guarded_getattr from AccessControl.ZopeGuards import get_safe_globals, guarded_getattr
from zLOG import LOG, ERROR, INFO, PROBLEM
from zExceptions import Forbidden from zExceptions import Forbidden
import Globals import Globals
LOG = logging.getLogger('Script (Python)')
# Track the Python bytecode version # Track the Python bytecode version
import imp import imp
Python_magic = imp.get_magic() Python_magic = imp.get_magic()
...@@ -209,7 +211,7 @@ class PythonScript(Script, Historical, Cacheable): ...@@ -209,7 +211,7 @@ class PythonScript(Script, Historical, Cacheable):
getattr(self, 'Script_magic', None) != Script_magic): getattr(self, 'Script_magic', None) != Script_magic):
global _log_complaint global _log_complaint
if _log_complaint: if _log_complaint:
LOG(self.meta_type, INFO, _log_complaint) LOG.info(_log_complaint)
_log_complaint = 0 _log_complaint = 0
# Changes here won't get saved, unless this Script is edited. # Changes here won't get saved, unless this Script is edited.
body = self._body.rstrip() body = self._body.rstrip()
...@@ -438,7 +440,7 @@ class PythonScript(Script, Historical, Cacheable): ...@@ -438,7 +440,7 @@ class PythonScript(Script, Historical, Cacheable):
else: else:
self._makeFunction() self._makeFunction()
except: except:
LOG(self.meta_type, ERROR, 'write failed', error=sys.exc_info()) LOG.error('write failed', error=sys.exc_info())
raise raise
def manage_FTPget(self): def manage_FTPget(self):
......
...@@ -437,7 +437,7 @@ class TransientObjectContainer(SimpleItem): ...@@ -437,7 +437,7 @@ class TransientObjectContainer(SimpleItem):
length = self._length() # XXX ReadConflictError hotspot length = self._length() # XXX ReadConflictError hotspot
if self._limit and length >= self._limit: if self._limit and length >= self._limit:
LOG('Transience', WARNING, LOG.warning(
('Transient object container %s max subobjects ' ('Transient object container %s max subobjects '
'reached' % self.getId()) 'reached' % self.getId())
) )
...@@ -799,8 +799,7 @@ class TransientObjectContainer(SimpleItem): ...@@ -799,8 +799,7 @@ class TransientObjectContainer(SimpleItem):
except (KeyError, AttributeError): except (KeyError, AttributeError):
path = self.getPhysicalPath() path = self.getPhysicalPath()
err = 'No such onAdd/onDelete method %s referenced via %s' err = 'No such onAdd/onDelete method %s referenced via %s'
LOG('Transience', LOG.warning(
WARNING,
err % (callback, '/'.join(path)), err % (callback, '/'.join(path)),
error=sys.exc_info() error=sys.exc_info()
) )
...@@ -820,8 +819,7 @@ class TransientObjectContainer(SimpleItem): ...@@ -820,8 +819,7 @@ class TransientObjectContainer(SimpleItem):
except: except:
# dont raise, just log # dont raise, just log
path = self.getPhysicalPath() path = self.getPhysicalPath()
LOG('Transience', LOG.warning(
WARNING,
'%s failed when calling %s in %s' % (name,callback, '%s failed when calling %s in %s' % (name,callback,
'/'.join(path)), '/'.join(path)),
error=sys.exc_info() error=sys.exc_info()
...@@ -831,8 +829,7 @@ class TransientObjectContainer(SimpleItem): ...@@ -831,8 +829,7 @@ class TransientObjectContainer(SimpleItem):
else: else:
err = '%s in %s attempted to call non-callable %s' err = '%s in %s attempted to call non-callable %s'
path = self.getPhysicalPath() path = self.getPhysicalPath()
LOG('Transience', LOG.warning(
WARNING,
err % (name, '/'.join(path), callback), err % (name, '/'.join(path), callback),
error=sys.exc_info() error=sys.exc_info()
) )
......
...@@ -170,8 +170,9 @@ class MonitorServerFactory(ServerFactory): ...@@ -170,8 +170,9 @@ class MonitorServerFactory(ServerFactory):
if password is None: if password is None:
msg = ('Monitor server not started because no emergency user ' msg = ('Monitor server not started because no emergency user '
'exists.') 'exists.')
import zLOG import logging
zLOG.LOG("Zope", zLOG.ERROR, msg) logger = logging.getLogger('Zope')
logger.error(msg)
return return
from ZServer.medusa.monitor import secure_monitor_server from ZServer.medusa.monitor import secure_monitor_server
return secure_monitor_server(hostname=self.host, port=self.port, return secure_monitor_server(hostname=self.host, port=self.port,
......
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