Skip to content

Instantly share code, notes, and snippets.

@bretthoerner
Created July 26, 2011 20:24
Show Gist options
  • Save bretthoerner/1107926 to your computer and use it in GitHub Desktop.
Save bretthoerner/1107926 to your computer and use it in GitHub Desktop.
from scribe import scribe
from thrift.transport import TTransport, TSocket
from thrift.protocol import TBinaryProtocol
category='event'
message='data goes here'
log_entry = scribe.LogEntry(category, message)
socket = TSocket.TSocket(host='localhost', port=1464)
transport = TTransport.TFramedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(trans=transport, strictRead=False, strictWrite=False)
client = scribe.Client(iprot=protocol, oprot=protocol)
transport.open()
result = client.Log(messages=[log_entry])
transport.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment