[Zope-Checkins] CVS: Zope3/src/ZODB - DB.py:1.76 ExportImport.py:1.25 lock_file.py:1.11

Gintautas Miliauskas gintas at pov.lt
Sat Apr 17 19:05:24 EDT 2004


Update of /cvs-repository/Zope3/src/ZODB
In directory cvs.zope.org:/tmp/cvs-serv22437

Modified Files:
	DB.py ExportImport.py lock_file.py 
Log Message:
Updated to use logging instead of zLOG.


=== Zope3/src/ZODB/DB.py 1.75 => 1.76 ===
--- Zope3/src/ZODB/DB.py:1.75	Thu Apr 15 12:41:42 2004
+++ Zope3/src/ZODB/DB.py	Sat Apr 17 19:04:52 2004
@@ -19,14 +19,16 @@
 from thread import allocate_lock
 from time import time, ctime
 import warnings
+import logging
 
 from ZODB.broken import find_global
 from ZODB.Connection import Connection
 from ZODB.serialize import referencesf
-from zLOG import LOG, ERROR
 
 import transaction
 
+logger = logging.getLogger('zodb.db')
+
 class DB(object):
     """The Object Database
     -------------------
@@ -601,7 +603,7 @@
         try:
             self._storage.pack(t, referencesf)
         except:
-            LOG("ZODB", ERROR, "packing", error=sys.exc_info())
+            logger.error("packing", exc_info=True)
             raise
 
     def setCacheSize(self, v):


=== Zope3/src/ZODB/ExportImport.py 1.24 => 1.25 ===
--- Zope3/src/ZODB/ExportImport.py:1.24	Thu Apr 15 21:08:12 2004
+++ Zope3/src/ZODB/ExportImport.py	Sat Apr 17 19:04:53 2004
@@ -16,13 +16,15 @@
 from cStringIO import StringIO
 from cPickle import Pickler, Unpickler
 from tempfile import TemporaryFile
+import logging
 
 from ZODB.POSException import ExportError
 from ZODB.utils import p64, u64
 from ZODB.serialize import referencesf
-import zLOG
 import sys
 
+logger = logging.getLogger('zodb.ExportImport')
+
 class ExportImport:
 
     def exportFile(self, oid, f=None):
@@ -43,9 +45,8 @@
             try:
                 p, serial = load(oid, self._version)
             except:
-                zLOG.LOG("ZODB", zLOG.DEBUG,
-                         "broken reference for oid %s" % `oid`,
-                         err=sys.exc_info())
+                logger.debug("broken reference for oid %s", repr(oid),
+                             exc_info=True)
             else:
                 referencesf(p, oids)
                 f.writelines([oid, p64(len(p)), p])


=== Zope3/src/ZODB/lock_file.py 1.10 => 1.11 ===
--- Zope3/src/ZODB/lock_file.py:1.10	Wed Feb  4 14:36:28 2004
+++ Zope3/src/ZODB/lock_file.py	Sat Apr 17 19:04:53 2004
@@ -15,6 +15,7 @@
 import os
 import errno
 import logging
+logger = logging.getLogger("ZODB.lock_file")
 
 try:
     import fcntl
@@ -23,10 +24,8 @@
         from winlock import LockFile as _LockFile
         from winlock import UnlockFile as _UnlockFile
     except ImportError:
-        import zLOG
         def lock_file(file):
-            zLOG.LOG('ZODB', zLOG.INFO,
-                     'No file-locking support on this platform')
+            logger.info('No file-locking support on this platform')
 
     # Windows
     def lock_file(file):
@@ -46,9 +45,8 @@
         # File is automatically unlocked on close
         pass
 
-log = logging.getLogger("LockFile")
 
-
+
 # This is a better interface to use than the lockfile.lock_file() interface.
 # Creating the instance acquires the lock.  The file remains open.  Calling
 # close both closes and unlocks the lock file.
@@ -64,7 +62,7 @@
         try:
             lock_file(self._fp)
         except:
-            log.exception("Error locking file %s" % path)
+            logger.exception("Error locking file %s", path)
             raise
         print >> self._fp, os.getpid()
         self._fp.flush()




More information about the Zope-Checkins mailing list