Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 21 lines (15 sloc) 0.545 kB
#!/usr/bin/env python
import puka
import sys
client = puka.Client("amqp://localhost/")
promise = client.connect()
client.wait(promise)
promise = client.exchange_declare(exchange='direct_logs', type='direct')
client.wait(promise)
severity = sys.argv[1] if len(sys.argv) > 1 else 'info'
message = ' '.join(sys.argv[2:]) or 'Hello World!'
promise = client.basic_publish(exchange='direct_logs', routing_key=severity,
body=message)
client.wait(promise)
print " [x] Sent %r:%r" % (severity, message)
client.close()
Jump to Line
Something went wrong with that request. Please try again.