dogtail r393 - in trunk: . dogtail



Author: zcerza
Date: Fri Aug  8 17:50:14 2008
New Revision: 393
URL: http://svn.gnome.org/viewvc/dogtail?rev=393&view=rev

Log:
2008-08-08  Zack Cerza <zcerza redhat com>

    * dogtail/logging.py: Make ResultsLogger log to a file no matter what.


Modified:
   trunk/ChangeLog
   trunk/dogtail/logging.py

Modified: trunk/dogtail/logging.py
==============================================================================
--- trunk/dogtail/logging.py	(original)
+++ trunk/dogtail/logging.py	Fri Aug  8 17:50:14 2008
@@ -132,18 +132,20 @@
         self.file.write("##### " + os.path.basename(self.fileName) + '\n')
         self.file.flush()
 
-    def log(self, message, newline = True):
+    def log(self, message, newline = True, force = False):
         """
         Hook used for logging messages. Might eventually be a virtual
         function, but nice and simple for now.
+
+        If force is True, log to a file irrespective of config.logDebugToFile.
         """
         message = message.decode('utf-8', 'replace')
 
         # Try to open and write the result to the log file.
-        if isinstance(self.file, bool) and config.logDebugToFile:
+        if isinstance(self.file, bool) and (force or config.logDebugToFile):
             self.createFile()
 
-        if config.logDebugToFile:
+        if force or config.logDebugToFile:
             if newline: self.file.write(message + '\n')
             else: self.file.write(message + ' ')
             self.file.flush()
@@ -178,7 +180,7 @@
             raise ValueError, entry
             print "Method argument requires a 1 {key: value} dict. Supplied argument not one {key: value}"
 
-        Logger.log(self, self.stamper.entryStamp() + "      " + entry)
+        Logger.log(self, self.stamper.entryStamp() + "      " + entry, force = True)
 
 debugLogger = Logger('debug', config.logDebugToFile)
 



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