[svn] commit: r1963 - /branches/trac176/src/lib/python/isc/log/log.py

BIND 10 source code commits bind10-changes at lists.isc.org
Fri May 28 08:28:59 UTC 2010


Author: chenzhengzhang
Date: Fri May 28 08:28:59 2010
New Revision: 1963

Log:
Modified exception handler


Modified:
    branches/trac176/src/lib/python/isc/log/log.py

Modified: branches/trac176/src/lib/python/isc/log/log.py
==============================================================================
--- branches/trac176/src/lib/python/isc/log/log.py (original)
+++ branches/trac176/src/lib/python/isc/log/log.py Fri May 28 08:28:59 2010
@@ -56,19 +56,17 @@
         """
         Update RotatingFileHandler configuration.
 
+        If the file path is not exists, we will use the old configuration.
         input:
             log file name
             max backup count
             predetermined log file size
         """
-        try:
-            self._open(file_name)
-        except IOError:
-            print("The file path is not exist!")
-            return 
-        self.baseFilename = file_name
-        self.maxBytes = max_bytes
-        self.backupCount = backup_count
+        dir = os.path.split(file_name)
+        if(os.path.exists(dir[0])):
+            self.baseFilename = file_name
+            self.maxBytes = max_bytes
+            self.backupCount = backup_count
 
 class SLHandler(logging.Handler):    
     """
@@ -194,8 +192,8 @@
 
     def update_rotate_handler(self, log_file, max_bytes, backup_count):
         """
-        If rotate handler has been added to the logger, update its configuration,
-        else add it to logger.
+        If the rotate handler has been added to the logger, update its configuration,
+        else add it to the logger.
     
         If log file is empty, the handler will be removed.
         """




More information about the bind10-changes mailing list