Commits

Marcin Kasperski  committed d2e9393

interactive_shell can be run with param debug

  • Participants
  • Parent commits 68b8a0a

Comments (0)

Files changed (1)

File sample/interactive_shell.py

 patch.
 """
 import pprint
+import sys
 
 from twisted.internet import stdio, reactor, defer
 from twisted.protocols import basic
             self.sendLine("###[%s]>>> FAILED %s(%s)" % (line, e.__class__.__name__, str(e)))
         self.transport.write(self.prompt)
 
-logging.basicConfig(level=logging.WARN)
 
 #################################################################################
 # Startup glue code
 
 if __name__ == "__main__":
 
+    if "debug" in sys.argv:
+        log_level=logging.DEBUG
+    else:
+        log_level=logging.WARN
+    logging.basicConfig(level=log_level)
+
     my_console = MyConsoleProtocol()
     my_client = MyFicsClient(my_console)
     reactor.connectTCP(