def stream_logs():
conf = Config()
# Request the correct streamer URL from siphon-web
auth = Auth()
siphon = Siphon(auth.auth_token)
# Track
mixpanel_event(MIXPANEL_EVENT_LOGS, properties={'app_id': conf.app_id})
streamer_url = siphon.get_streamer_url(conf.app_id, 'log_reader')
puts(colored.yellow('Connecting...'))
ws = websocket.create_connection(streamer_url)
puts(colored.green('Streaming logs and errors... (ctrl-c to stop)\n'))
try:
for line in ws:
print(line)
except KeyboardInterrupt:
puts(colored.yellow('\nClosing the connection.'))
ws.close()
评论列表
文章目录