def emit(self, record):
        level = self.encodePriority(record)
        message = record.getMessage()
        # The Linux domain socket datagram size limit is 8 KB, but
        # with the extra padding introduced by the log function, the
        # incoming message needs to be smaller - we truncate it to
        # at most 8015 bytes here.
        # Note: we use Python 2 semantics here (byte strings). This
        # script is not Python 3 ready. If *line* was a unicode string
        # with wide chars, its byte length would exceed the limit.
        if 8015 > len(message):
            message = message[:8000] + "... [truncated]"

        data = json.dumps({"source": self.source, "timestamp": int(round(time.time() * 1000)),
                           "level": level, "msg": message})

        levelno = int(record.levelno)
        if levelno >= logging.CRITICAL or (levelno == logging.INFO and message.startswith(b"CPU: ")):
            # Critical, alert, emerg, or resource status
            cur_socket = self.priority_log_socket
            cur_socket_address = self.priority_log_address
        else:
            cur_socket = self.bulk_log_socket
            cur_socket_address = self.bulk_log_address

        try:
            cur_socket.send(data)
        except socket.error:
            cur_socket.connect(cur_socket_address)
            cur_socket.send(data)
        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/dxpy/dxlog.py/DXLogHandler.emit/swapped operands of `>`