From 29a40c8fcbbf2a09515b3e5e6423d6991c2027f6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 10 Aug 2010 15:42:35 -0400 Subject: [PATCH] Log execution debug messages from the commandline UI (matching the GUI). --- hooke/ui/commandline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooke/ui/commandline.py b/hooke/ui/commandline.py index 4533217..53291a2 100644 --- a/hooke/ui/commandline.py +++ b/hooke/ui/commandline.py @@ -22,6 +22,7 @@ line. import codecs import cmd +import logging import optparse try: import readline # including readline makes cmd.Cmd.cmdloop() smarter @@ -118,6 +119,7 @@ class DoCommand (CommandMethod): def __init__(self, *args, **kwargs): super(DoCommand, self).__init__(*args, **kwargs) self.parser = CommandLineParser(self.command, self.name_fn) + self.log = logging.getLogger('hooke') def __call__(self, args): try: @@ -126,7 +128,7 @@ class DoCommand (CommandMethod): self.cmd.stdout.write(str(e).lstrip()+'\n') self.cmd.stdout.write('Failure\n') return - print args + self.log.debug('executing %s with %s' % (self.command.name, args)) self.cmd.inqueue.put(CommandMessage(self.command, args)) while True: msg = self.cmd.outqueue.get() -- 2.26.2