From: W. Trevor King Date: Tue, 10 Aug 2010 19:42:35 +0000 (-0400) Subject: Log execution debug messages from the commandline UI (matching the GUI). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=29a40c8fcbbf2a09515b3e5e6423d6991c2027f6;p=hooke.git Log execution debug messages from the commandline UI (matching the GUI). --- 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()