Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added useful debugging lines

  • Loading branch information...
commit 85db1ee768d44c9e7442bfbe808d0e807fb5acef 1 parent fc377f8
@dvarrazzo authored
View
1  pgxnclient/commands/__init__.py
@@ -211,6 +211,7 @@ def popen(self, cmd, *args, **kwargs):
Commands should use this method instead of importing subprocess.Popen:
this allows replacement with a mock in the test suite.
"""
+ logger.debug("running command: %s", cmd)
try:
return Popen(cmd, *args, **kwargs)
except OSError, e:
View
6 pgxnclient/commands/install.py
@@ -236,10 +236,16 @@ def load_sql(self, filename=None, data=None):
cmdline.extend(self.get_psql_options())
# load via pipe to enable psql commands in the file
if not data:
+ logger.debug("loading sql from %s", filename)
fin = open(filename, 'r')
p = self.popen(cmdline, stdin=fin)
p.communicate()
else:
+ if len(data) > 105:
+ tdata = data[:100] + "..."
+ else:
+ tdata = data
+ logger.debug('running sql command: "%s"', tdata)
p = self.popen(cmdline, stdin=PIPE)
p.communicate(data)
Please sign in to comment.
Something went wrong with that request. Please try again.