summaryrefslogtreecommitdiff
path: root/python/examples
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-10-12 11:19:09 +0000
committerRafael H. Schloming <rhs@apache.org>2009-10-12 11:19:09 +0000
commita4e1595263c5595af6ec04d09df94c02155cb644 (patch)
treefbd919bea9d83b15fc5284b10017245f2a32b5f0 /python/examples
parent9e32ffd2a58e6c22193aa6b856840fbf815a8a92 (diff)
downloadqpid-python-a4e1595263c5595af6ec04d09df94c02155cb644.tar.gz
added an option for logging
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@824297 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/examples')
-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)