[Zope-Checkins] CVS: Zope3/src/ZODB - Mount.py:1.24

Gintautas Miliauskas gintas at pov.lt
Thu Apr 22 17:28:14 EDT 2004


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

Modified Files:
	Mount.py 
Log Message:
This should finally rid ZODB of obsolete zLOG imports. I hope nothing's
processing the messages because the format might have changed a little bit.


=== Zope3/src/ZODB/Mount.py 1.23 => 1.24 ===
--- Zope3/src/ZODB/Mount.py:1.23	Thu Mar  4 17:41:50 2004
+++ Zope3/src/ZODB/Mount.py	Thu Apr 22 17:27:43 2004
@@ -16,11 +16,17 @@
 $Id$"""
 __version__='$Revision$'[11:-2]
 
-import thread, persistent, Acquisition
+import string
+import time
+import sys
+import thread
+import logging
+import persistent
+import Acquisition
 from Acquisition import aq_base
-import string, time, sys
 from POSException import MountedStorageError
-from zLOG import LOG, INFO, WARNING
+
+logger = logging.getLogger('zodb.Mount')
 
 # dbs is a holder for all DB objects, needed to overcome
 # threading issues.  It maps connection params to a DB object
@@ -99,7 +105,7 @@
             params = self._params
             dbInfo = dbs.get(params, None)
             if dbInfo is None:
-                LOG('ZODB', INFO, 'Opening database for mounting: %s' % params)
+                logger.info('Opening database for mounting: %s', params)
                 db = self._createDB()
                 newMount = 1
                 dbs[params] = (db, {self.__mountpoint_id:1})
@@ -183,8 +189,8 @@
                 try: id = data.getId()
                 except: id = '???'  # data has no getId() method.  Bad.
                 p = string.join(parent.getPhysicalPath() + (id,), '/')
-                LOG('ZODB', INFO, 'Mounted database %s at %s' %
-                    (self._getMountParams(), p))
+                logger.info('Mounted database %s at %s',
+                            self._getMountParams(), p)
         else:
             data = t[0]
 
@@ -229,9 +235,8 @@
         except:
             from StringIO import StringIO
         import traceback
-        exc = sys.exc_info()
-        LOG('ZODB', WARNING, 'Failed to mount database. %s (%s)' % exc[:2],
-            error=exc)
+        logger.warning('Failed to mount database. %s (%s)', exc[:2],
+                       exc_info=True)
         f=StringIO()
         traceback.print_tb(exc[2], 100, f)
         self._v_connect_error = (exc[0], exc[1], f.getvalue())
@@ -275,8 +280,10 @@
                     del data.__dict__['_v__object_deleted__']
                     close_db = 1
             # Close the child connection.
-            try: del conn._mount_parent_jar
-            except: pass
+            try:
+                del conn._mount_parent_jar
+            except:
+                pass
             conn.close()
 
         if close_db:
@@ -295,6 +302,6 @@
                         # No more mount points are using this database.
                         del dbs[params]
                         db.close()
-                        LOG('ZODB', INFO, 'Closed database: %s' % params)
+                        logger.info('Closed database: %s', params)
             finally:
                 dblock.release()




More information about the Zope-Checkins mailing list