Skip to main content

A Python 3-compatible client for Facebook Scribe

Project description

This is a Python client for scribe that can be installed using pip:

pip install facebook-scribe

Usage

Connect to HOST:9999 using Thrift:

from scribe import scribe
from thrift.transport import TTransport, TSocket
from thrift.protocol import TBinaryProtocol

socket = TSocket.TSocket(host="HOST", port=9999)
transport = TTransport.TFramedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(trans=transport, strictRead=False, strictWrite=False)
client = scribe.Client(protocol)
transport.open()

category = 'LOGS'
message = 'hello world'

log_entry = scribe.LogEntry(category, message)
result = client.Log(messages=[log_entry])
if result == 0:
  print 'success'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facebook-scribe-py3-0.1.1.tar.gz (6.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page