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