Permalink
Browse files

command: more verbose logging by intergrating with twisted.log

  • Loading branch information...
Marc Sibson
Marc Sibson committed Feb 24, 2011
1 parent 74a8328 commit f95df6bbf7a34c13868eca8de8cd0f8ec37d32ac
Showing with 5 additions and 8 deletions.
  1. +5 −8 vncdotool/command.py
View
@@ -9,17 +9,13 @@
import optparse
from twisted.internet import reactor
-
+from twisted.python import log
from vncdotool.client import VNCDoToolFactory, VNCDoToolClient
import sys
-def logger(fmt, *args):
- print fmt % args
-
-
def log_connected(pcol):
- print 'connected to', pcol.name
+ log.msg('connected to %s' % pcol.name)
return pcol
@@ -115,8 +111,9 @@ def main():
factory.password = opts.password
if opts.verbose:
- print 'connecting to %s:%d' % (opts.host, opts.port)
- factory.logger = logger
+ log.msg('connecting to %s:%s' % (host, port))
+ factory.logger = log.msg
+ log.startLogging(sys.stdout)
if opts.verbose:
factory.deferred.addCallbacks(log_connected)

0 comments on commit f95df6b

Please sign in to comment.