summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rwxr-xr-xpython/examples/api/server7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/examples/api/server b/python/examples/api/server
index 4e986f5ac8..adb2dcf792 100755
--- a/python/examples/api/server
+++ b/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)