Commit 5c4431b7 authored by Andreas Jung's avatar Andreas Jung

dprecated zLOG module

parent 5464fb23
...@@ -26,6 +26,8 @@ Zope Changes ...@@ -26,6 +26,8 @@ Zope Changes
Features added Features added
- deprecated the zLOG module. Use Pythons 'logging' module instead
- PluginIndexes/TextIndex is deprecated. Use ZCTextIndex instead - PluginIndexes/TextIndex is deprecated. Use ZCTextIndex instead
- the 'StructuredText' module is deprecated. Use zope.structuredtext - the 'StructuredText' module is deprecated. Use zope.structuredtext
......
...@@ -180,7 +180,6 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes): ...@@ -180,7 +180,6 @@ class PropertyManager(ExtensionClass.Base, ZDOM.ElementWithAttributes):
# for selection and multiple selection properties # for selection and multiple selection properties
# the value argument indicates the select variable # the value argument indicates the select variable
# of the property # of the property
self._wrapperCheck(value) self._wrapperCheck(value)
if not self.valid_property_id(id): if not self.valid_property_id(id):
raise BadRequest, 'Invalid or duplicate property id' raise BadRequest, 'Invalid or duplicate property id'
......
...@@ -21,6 +21,7 @@ from cgi import escape ...@@ -21,6 +21,7 @@ from cgi import escape
from urllib import quote from urllib import quote
from random import randint from random import randint
from types import StringType from types import StringType
from logging import getLogger
import Globals import Globals
from Globals import DTMLFile from Globals import DTMLFile
...@@ -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
...@@ -46,6 +46,8 @@ from OFS.event import ObjectWillBeRemovedEvent ...@@ -46,6 +46,8 @@ from OFS.event import ObjectWillBeRemovedEvent
import OFS.subscribers import OFS.subscribers
LOG = getLogger('BTreeFolder2')
manage_addBTreeFolderForm = DTMLFile('folderAdd', globals()) manage_addBTreeFolderForm = DTMLFile('folderAdd', globals())
def manage_addBTreeFolder(dispatcher, id, title='', REQUEST=None): def manage_addBTreeFolder(dispatcher, id, title='', REQUEST=None):
...@@ -191,9 +193,8 @@ class BTreeFolder2Base (Persistent): ...@@ -191,9 +193,8 @@ 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, exc_info=sys.exc_info())
error=sys.exc_info())
try: try:
self._tree = OOBTree(self._tree) self._tree = OOBTree(self._tree)
mt_index = OOBTree() mt_index = OOBTree()
...@@ -201,11 +202,11 @@ class BTreeFolder2Base (Persistent): ...@@ -201,11 +202,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()) exc_info=sys.exc_info())
raise raise
else: else:
LOG('BTreeFolder2', INFO, 'Fixed %s.' % path) LOG.info('Fixed %s.' % path)
return 0 return 0
......
...@@ -40,7 +40,7 @@ from AccessControl import ClassSecurityInfo, getSecurityManager ...@@ -40,7 +40,7 @@ from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, \ from AccessControl.SecurityManagement import newSecurityManager, \
setSecurityManager setSecurityManager
from AccessControl.User import nobody from AccessControl.User import nobody
from zLOG import LOG, WARNING, INFO from logging import getLogger
from TransientObject import TransientObject from TransientObject import TransientObject
from Fake import FakeIOBTree from Fake import FakeIOBTree
...@@ -59,6 +59,7 @@ STRICT = os.environ.get('Z_TOC_STRICT', '') ...@@ -59,6 +59,7 @@ STRICT = os.environ.get('Z_TOC_STRICT', '')
DEBUG = int(os.environ.get('Z_TOC_DEBUG', 0)) DEBUG = int(os.environ.get('Z_TOC_DEBUG', 0))
_marker = [] _marker = []
LOG = getLogger('Transience')
def setStrict(on=''): def setStrict(on=''):
""" Turn on assertions (which may cause conflicts) """ """ Turn on assertions (which may cause conflicts) """
...@@ -72,7 +73,7 @@ def TLOG(*args): ...@@ -72,7 +73,7 @@ def TLOG(*args):
for arg in args: for arg in args:
sargs.append(str(arg)) sargs.append(str(arg))
msg = ' '.join(sargs) msg = ' '.join(sargs)
LOG('Transience', INFO, msg) LOG.info(msg)
constructTransientObjectContainerForm = HTMLFile( constructTransientObjectContainerForm = HTMLFile(
'dtml/addTransientObjectContainer', globals()) 'dtml/addTransientObjectContainer', globals())
......
...@@ -38,7 +38,6 @@ from Products.PluginIndexes.common.PluggableIndex \ ...@@ -38,7 +38,6 @@ from Products.PluginIndexes.common.PluggableIndex \
import PluggableIndexInterface import PluggableIndexInterface
from Products.PluginIndexes.interfaces import IPluggableIndex from Products.PluginIndexes.interfaces import IPluggableIndex
from Products.PluginIndexes.TextIndex import Splitter from Products.PluginIndexes.TextIndex import Splitter
from zLOG import LOG
from zope.interface import implements from zope.interface import implements
from Catalog import Catalog, CatalogError from Catalog import Catalog, CatalogError
......
...@@ -77,6 +77,8 @@ back-end; configuration of the logging module must be handled ...@@ -77,6 +77,8 @@ back-end; configuration of the logging module must be handled
somewhere else. somewhere else.
""" """
import warnings
from EventLogger import log_write, log_time, severity_string from EventLogger import log_write, log_time, severity_string
from traceback import format_exception from traceback import format_exception
...@@ -131,6 +133,13 @@ def LOG(subsystem, severity, summary, detail='', error=None, reraise=None): ...@@ -131,6 +133,13 @@ def LOG(subsystem, severity, summary, detail='', error=None, reraise=None):
error is reraised. error is reraised.
""" """
warnings.warn('Using the zLOG module is deprecated (to be removed in '
'Zope 2.12. Use the Python logging module instead.'
DeprecationWarning,
stacklevel=2)
log_write(subsystem, severity, summary, detail, error) log_write(subsystem, severity, summary, detail, error)
if reraise and error: if reraise and error:
raise error[0], error[1], error[2] raise error[0], error[1], error[2]
......
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