projects
/
hooke.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
36d7ce5
)
Log execution debug messages from the commandline UI (matching the GUI).
author
W. Trevor King
<wking@drexel.edu>
Tue, 10 Aug 2010 19:42:35 +0000
(15:42 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Tue, 10 Aug 2010 19:42:35 +0000
(15:42 -0400)
hooke/ui/commandline.py
patch
|
blob
|
history
diff --git
a/hooke/ui/commandline.py
b/hooke/ui/commandline.py
index 4533217222eb467bab441d29e1f62f6ff210f121..53291a25e1a4df2420fb0f43dcfbf1e1302d8b61 100644
(file)
--- a/
hooke/ui/commandline.py
+++ b/
hooke/ui/commandline.py
@@
-22,6
+22,7
@@
line.
import codecs
import cmd
import codecs
import cmd
+import logging
import optparse
try:
import readline # including readline makes cmd.Cmd.cmdloop() smarter
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)
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:
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
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()
self.cmd.inqueue.put(CommandMessage(self.command, args))
while True:
msg = self.cmd.outqueue.get()