[Python-checkins] python/dist/src/Lib/logging handlers.py,1.9,1.10

vsajip at users.sourceforge.net vsajip at users.sourceforge.net
Sat Feb 21 17:14:37 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/logging
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24606

Modified Files:
	handlers.py 
Log Message:
Added close() (which flushes) to BufferingHandler and tidied MemoryHandler.close() [SF #901330]

Index: handlers.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/logging/handlers.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** handlers.py	20 Feb 2004 13:17:27 -0000	1.9
--- handlers.py	21 Feb 2004 22:14:34 -0000	1.10
***************
*** 1,3 ****
! # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
  #
  # Permission to use, copy, modify, and distribute this software and its
--- 1,3 ----
! # Copyright 2001-2004 by Vinay Sajip. All Rights Reserved.
  #
  # Permission to use, copy, modify, and distribute this software and its
***************
*** 727,730 ****
--- 727,739 ----
          self.buffer = []
  
+     def close(self):
+         """
+         Close the handler.
+ 
+         This version just flushes and chains to the parent class' close().
+         """
+         self.flush()
+         logging.Handler.close(self)
+ 
  class MemoryHandler(BufferingHandler):
      """
***************
*** 775,778 ****
          self.flush()
          self.target = None
-         self.buffer = []
          BufferingHandler.close(self)
--- 784,786 ----




More information about the Python-checkins mailing list