summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-10-18 21:43:05 +0000
committerGerrit Code Review <review@openstack.org>2013-10-18 21:43:05 +0000
commit775a24b1bcb580216754e56b5384f05815372791 (patch)
treeb3bcafa2f0d18550d69d05458f1c1b3ba1bee772 /bin
parent1f2717e3345bbb5306b85c7c62c694b33da6dbcb (diff)
parentb682935055fccbbbad988e75679dfc01b0869622 (diff)
downloadpython-swiftclient-775a24b1bcb580216754e56b5384f05815372791.tar.gz
Merge "enhance swiftclient logging"
Diffstat (limited to 'bin')
-rwxr-xr-xbin/swift16
1 files changed, 11 insertions, 5 deletions
diff --git a/bin/swift b/bin/swift
index 1b298d1..01c7af4 100755
--- a/bin/swift
+++ b/bin/swift
@@ -1270,7 +1270,7 @@ if __name__ == '__main__':
parser = OptionParser(version='%%prog %s' % version,
usage='''
usage: %%prog [--version] [--help] [--snet] [--verbose]
- [--debug] [--quiet] [--auth <auth_url>]
+ [--debug] [--info] [--quiet] [--auth <auth_url>]
[--auth-version <auth_version>] [--user <username>]
[--key <api_key>] [--retries <num_retries>]
[--os-username <auth-user-name>] [--os-password <auth-password>]
@@ -1315,8 +1315,11 @@ Examples:
parser.add_option('-v', '--verbose', action='count', dest='verbose',
default=1, help='Print more info')
parser.add_option('--debug', action='store_true', dest='debug',
- default=False, help='Show the curl commands of all http '
- 'queries.')
+ default=False, help='Show the curl commands and results '
+ 'of all http queries regardless of result status.')
+ parser.add_option('--info', action='store_true', dest='info',
+ default=False, help='Show the curl commands and results '
+ ' of all http queries which return an error.')
parser.add_option('-q', '--quiet', action='store_const', dest='verbose',
const=0, default=1, help='Suppress status output')
parser.add_option('-A', '--auth', dest='auth',
@@ -1438,9 +1441,12 @@ Examples:
signal.signal(signal.SIGINT, immediate_exit)
- if options.debug:
+ if options.debug or options.info:
logger = logging.getLogger("swiftclient")
- logging.basicConfig(level=logging.DEBUG)
+ if options.debug:
+ logging.basicConfig(level=logging.DEBUG)
+ elif options.info:
+ logging.basicConfig(level=logging.INFO)
had_error = False