From a4e1595263c5595af6ec04d09df94c02155cb644 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Mon, 12 Oct 2009 11:19:09 +0000 Subject: added an option for logging git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@824297 13f79535-47bb-0310-9956-ffa450edef68 --- python/examples/api/server | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'python/examples/api') 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) -- cgit v1.2.1