Skip to content

Instantly share code, notes, and snippets.

@charsyam
Created January 8, 2021 18:19
Show Gist options
  • Save charsyam/99a936c9c8a39379c75224b0f1f93e31 to your computer and use it in GitHub Desktop.
Save charsyam/99a936c9c8a39379c75224b0f1f93e31 to your computer and use it in GitHub Desktop.
from thrift.protocol import TBinaryProtocol
from thrift.transport import TTransport
from schemas.singer.ttypes import LogMessage
fstream = open("./tf.log","rb")
transport = TTransport.TFramedTransport(TTransport.TFileObjectTransport(fstream))
protocol = TBinaryProtocol.TBinaryProtocol(transport)
transport.open()
while True:
log = LogMessage()
log.read(protocol)
print(log)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment