summaryrefslogtreecommitdiff
path: root/qpid/python/hello-010-world
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-03-11 14:29:17 +0000
committerRafael H. Schloming <rhs@apache.org>2008-03-11 14:29:17 +0000
commit41519ccf105e29b5762f1e3b724a015a50128150 (patch)
treecbc969e6dc850480be38cc8f7a0eb73b12a021c2 /qpid/python/hello-010-world
parentaab8bdfcf3d279758124fc01213f33563a73040f (diff)
downloadqpid-python-41519ccf105e29b5762f1e3b724a015a50128150.tar.gz
added convenience API for turning on logging; added logging for controls and commands; made logging prettier
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@635939 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/hello-010-world')
-rwxr-xr-xqpid/python/hello-010-world11
1 files changed, 6 insertions, 5 deletions
diff --git a/qpid/python/hello-010-world b/qpid/python/hello-010-world
index 83e7c87675..a15817cd9d 100755
--- a/qpid/python/hello-010-world
+++ b/qpid/python/hello-010-world
@@ -1,18 +1,19 @@
#!/usr/bin/env python
-import sys, logging
+import sys
from qpid.connection010 import Connection
from qpid.spec010 import load
from qpid.util import connect
from qpid.datatypes import Message, RangedSet
+from qpid.log import enable, DEBUG, WARN
if "-v" in sys.argv:
- level = logging.DEBUG
+ level = DEBUG
else:
- level = logging.WARN
+ level = WARN
-format = "%(asctime)s %(name)-12s %(levelname)-8s %(message)s"
-logging.basicConfig(level=level, format=format, datefmt='%H:%M:%S')
+enable("qpid.io.ctl", level)
+enable("qpid.io.cmd", level)
spec = load("../specs/amqp.0-10.xml")
conn = Connection(connect("0.0.0.0", spec.port), spec)