Skip to content

Commit

Permalink
Added basic logging configuration to example programs to avoid a logg…
Browse files Browse the repository at this point in the history
…ing error message.
  • Loading branch information
brimcfadden committed Jul 15, 2011
1 parent 8c8857e commit b0c2dfe
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/tutorial1/receive.py
@@ -1,4 +1,6 @@
#! /usr/bin/env python

import logging
from tornado.ioloop import IOLoop
from stormed import Connection, Message

Expand All @@ -10,6 +12,7 @@ def on_connect():
def callback(msg):
print " [x] Received %r" % msg.body

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
2 changes: 2 additions & 0 deletions examples/tutorial1/send.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import logging
from tornado.ioloop import IOLoop
from stormed import Connection, Message

Expand All @@ -15,6 +16,7 @@ def done():
print " [x] Sent 'Hello World!'"
io_loop.stop()

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
2 changes: 2 additions & 0 deletions examples/tutorial2/new_task.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import logging
import sys
from tornado.ioloop import IOLoop
from stormed import Connection, Message
Expand All @@ -17,6 +18,7 @@ def done():
print " [x] Sent %r" % msg.body
io_loop.stop()

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
2 changes: 2 additions & 0 deletions examples/tutorial2/worker.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import logging
import time
from tornado.ioloop import IOLoop
from stormed import Connection, Message
Expand All @@ -19,6 +20,7 @@ def done(msg):
print " [x] Done"
msg.ack()

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
2 changes: 2 additions & 0 deletions examples/tutorial3/emit_log.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import logging
import sys
from tornado.ioloop import IOLoop
from stormed import Connection, Message
Expand All @@ -17,6 +18,7 @@ def done():
print " [x] Sent %r" % msg.body
io_loop.stop()

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
3 changes: 3 additions & 0 deletions examples/tutorial3/receive_logs.py
@@ -1,4 +1,6 @@
#! /usr/bin/env python

import logging
from tornado.ioloop import IOLoop
from stormed import Connection, Message

Expand All @@ -17,6 +19,7 @@ def with_temp_queue(qinfo):
def callback(msg):
print " [x] %r" % msg.body

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
2 changes: 2 additions & 0 deletions examples/tutorial4/emit_log_direct.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import logging
import sys
from tornado.ioloop import IOLoop
from stormed import Connection, Message
Expand All @@ -18,6 +19,7 @@ def done():
print " [x] Sent %r:%r" % (severity, msg.body)
io_loop.stop()

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
3 changes: 3 additions & 0 deletions examples/tutorial4/receive_logs_direct.py
@@ -1,4 +1,6 @@
#! /usr/bin/env python

import logging
import sys
from tornado.ioloop import IOLoop
from stormed import Connection, Message
Expand Down Expand Up @@ -26,6 +28,7 @@ def with_temp_queue(qinfo):
def callback(msg):
print " [x] %r:%r" % (msg.rx_data.routing_key, msg.body)

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
2 changes: 2 additions & 0 deletions examples/tutorial5/emit_log_topic.py
@@ -1,5 +1,6 @@
#! /usr/bin/env python

import logging
import sys
from tornado.ioloop import IOLoop
from stormed import Connection, Message
Expand All @@ -18,6 +19,7 @@ def done():
print " [x] Sent %r:%r" % (routing_key, msg.body)
io_loop.stop()

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down
3 changes: 3 additions & 0 deletions examples/tutorial5/receive_logs_topic.py
@@ -1,4 +1,6 @@
#! /usr/bin/env python

import logging
import sys
from tornado.ioloop import IOLoop
from stormed import Connection, Message
Expand Down Expand Up @@ -26,6 +28,7 @@ def with_temp_queue(qinfo):
def callback(msg):
print " [x] %r:%r" % (msg.rx_data.routing_key, msg.body)

logging.basicConfig()
conn = Connection(host='localhost')
conn.connect(on_connect)
io_loop = IOLoop.instance()
Expand Down

0 comments on commit b0c2dfe

Please sign in to comment.