def poll_barix(b_obj, log_fh):
    try:
        if not b_obj.ping():
            return

        level_history.append(
            (float(b_obj.left_level), float(b_obj.right_level)))
        if len(level_history) > LEVEL_HISTORY_MAX_SIZE:
            level_history.pop(0)

        if log_fh:
            now = int(b_obj.last_update_time)
            ip, far_port = b_obj.clients.get("12345", ("None", 0))
            log_info = "%d %04x %s\n" % (now, int(far_port), ip)
            log_fh.write(log_info)
            log_fh.flush()

    except Exception, err:
        logging.exception("Swallowed exception")