def __init__(self): super(LoggerClient, self).__init__() self.parent = current_thread() self._stopped = False self._queue = Queue.Queue() self._client = BinderClient("log_writer")
def get_app_logs(app, start_time): lines = [] bc = BinderClient("log_reader") rsp = bc.send({"type": "get", "app": app, "since": start_time}) if rsp["type"] == "success": lines = rsp["msg"].split("\n") else: error_log("LoggerClient", "read_stream failure for app {}: {}".format(app, rsp)) bc.close() return lines
def stop_daemon(): # stop the binderd process (by sending a 'stop' message to the control socket): with BinderClient() as client: client.stop_daemon()