[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Improve documentation on log streams



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv19964/lib/mixminion

Modified Files:
	Common.py 
Log Message:
Improve documentation on log streams

Index: Common.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Common.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- Common.py	17 Jan 2003 06:18:06 -0000	1.53
+++ Common.py	4 Feb 2003 02:02:51 -0000	1.54
@@ -531,13 +531,21 @@
        We don't actually want to use these; but they keep us from dropping
        prints on the floor.
        """
+    # Fields:
+    #    name -- The name of this stream
+    #    severity -- The severity of log messages to generate.
+    #    buf -- A list of strings that have been written to this stream since
+    #        we most recently flushed the buffer to the log.
     def __init__(self, name, severity):
         self.name = name
         self.severity = severity
-        self.buf = [] #DOCDOC
+        self.buf = [] 
     def write(self, s):
-        #DOCDOC justify this inefficiency.
-        #LOG.log(self.severity, "called with %r", s)
+        # This is inefficient, but we don't actually use this class if we can
+        # avoid it.  The basic idea is to generate a call to Log.log for every
+        # newline.  (This buffering is particularly necessary because typical
+        # uses of sys.stdout/stderr generate multiple calls to file.write per
+        # line.)
         if "\n" not in s:
             self.buf.append(s)
             return