You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To send a message to a Scribe Server running on a given machine and port, we simply need to create a Scribe Client and call Log(). Here is an example using Python:
from scribe import scribe
from thrift.transport import TTransport, TSocket
from thrift.protocol import TBinaryProtocol
category='test'
message='hello world'
log_entry = scribe.LogEntry(category, message)
# depending on thrift version
# log_entry = scribe.LogEntry(dict(category=category, message=message))
socket = TSocket.TSocket(host='localhost', port=1456)
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()