diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-10-12 11:19:09 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-10-12 11:19:09 +0000 |
| commit | eef12c6a8f8d62747b2dfa933fef7838e656fc59 (patch) | |
| tree | f0b9218c9c036d1251dfa1c72899a853898630c4 /qpid/python/examples/api | |
| parent | 56e7fca9735459c62b5cca4a35376faf64a992f2 (diff) | |
| download | qpid-python-eef12c6a8f8d62747b2dfa933fef7838e656fc59.tar.gz | |
added an option for logging
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@824297 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/examples/api')
| -rwxr-xr-x | qpid/python/examples/api/server | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qpid/python/examples/api/server b/qpid/python/examples/api/server index 4e986f5ac8..adb2dcf792 100755 --- a/qpid/python/examples/api/server +++ b/qpid/python/examples/api/server @@ -22,14 +22,21 @@ import optparse, sys, traceback from qpid.messaging import * from qpid.util import URL from subprocess import Popen, STDOUT, PIPE +from qpid.log import enable, DEBUG, WARN parser = optparse.OptionParser(usage="usage: %prog [options] ADDRESS ...", description="handle requests from the supplied address.") parser.add_option("-b", "--broker", default="localhost", help="connect to specified BROKER (default %default)") +parser.add_option("-v", dest="verbose", action="store_true", help="enable logging") opts, args = parser.parse_args() +if opts.verbose: + enable("qpid", DEBUG) +else: + enable("qpid", WARN) + url = URL(opts.broker) if args: addr = args.pop(0) |
