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

dprecated zLOG module

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