[Shtoom] what happens to stdout in text-mode UI?

Zooko Wilcox-O'Hearn zooko at zooko.com
Mon Oct 4 14:43:08 CEST 2004


Here is a patch which sends log messages to a text file in the text ui.

Index: shtoom/ui/textui/main.py
===================================================================
--- shtoom/ui/textui/main.py    (revision 818)
+++ shtoom/ui/textui/main.py    (working copy)
@@ -11,6 +11,9 @@
      from os import linesep as delimiter
      sipURL = None

+    def getLogger(self):
+        return open("shtoom.log", "w")
+
      def debugMessage(self, msg):
          if self._debug:
              print msg
Index: shtoom/ui/textshtoom.py
===================================================================
--- shtoom/ui/textshtoom.py     (revision 818)
+++ shtoom/ui/textshtoom.py     (working copy)
@@ -18,7 +18,7 @@
      UI = ShtoomMain()
      UI.connectApplication(application)
      stdio.StandardIO(UI)
-    #log.startLogging(UI.getLogger())
-    log.startLogging(sys.stdout)
+    log.startLogging(UI.getLogger())
+    # log.startLogging(sys.stdout) # This causes mucho problemas, as 
described in this post: 
http://mail.python.org/pipermail/shtoom/2004-October/000049.html
      return UI




More information about the Shtoom mailing list