[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Only print the "Silencing the console log" message once.



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

Modified Files:
	Common.py 
Log Message:
Only print the "Silencing the console log" message once.


Index: Common.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Common.py,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- Common.py	3 Sep 2003 15:49:25 -0000	1.110
+++ Common.py	3 Sep 2003 16:13:23 -0000	1.111
@@ -826,11 +826,14 @@
     ## Fields:
     # handlers: a list of logHandler objects.
     # severity: a severity below which log messages are ignored.
+    # silenceNoted: true iff we have printed a message about silencing the
+    #     console long.
     def __init__(self, minSeverity):
         """Create a new Log object that ignores all message less severe than
            minSeverity, and sends its output to stderr."""
         self.configure(None)
         self.setMinSeverity(minSeverity)
+        self.silenceNoted = 0
         self.__lock = threading.Lock()
 
     def configure(self, config, keepStderr=0):
@@ -861,8 +864,10 @@
                     return
                 if (config['Server'].get('Daemon',0) or
                     not config['Server'].get('EchoMessages',0)):
-                    print "Silencing the console log; look in %s instead"%(
-                        logfile)
+                    if not self.silenceNoted:
+                        print "Silencing the console log; look in %s instead"%(
+                            logfile)
+                        self.silenceNoted = 1
                     del self.handlers[0]
 
     def setMinSeverity(self, minSeverity):