def log_entry( self, logger, entry ):
        # check to see if redis truncated the command
        match = MORE_BYTES.search( entry['command'] )
        if match:
            pos, length = match.span()
            pos -= 1
            # find the first byte which is not a 'middle' byte in utf8
            # middle bytes always begin with b10xxxxxx which means they
            # will be >= b10000000 and <= b10111111
            while pos > 0 and 0x80 <= ord( entry['command'][pos] ) <= 0xBF:
                pos -= 1

            # at this point, entry['command'][pos] will either be a single byte character or
            # the start of a truncated multibyte character.
            # If it's a single character, skip over it so it's included in the slice
            # If it's the start of a truncated multibyte character don't do anything
            # and the truncated bytes will be removed with the slice
            if ord( entry['command'][pos] ) < 0x80:
                pos += 1

            #slice off any unwanted parts of the string
            entry['command'] = entry['command'][:pos] + match.group()

        command = ""
        try:
            command = entry['command'].decode( 'utf8' )
        except __HOLE__, e:
            if self.utf8_warning_interval:
                logger.warn( "Redis command contains invalid utf8: %s" % binascii.hexlify( entry['command'] ), limit_once_per_x_secs=self.utf8_warning_interval, limit_key="redis-utf8" )
            command = entry['command'].decode( 'utf8', errors="replace" )

        time_format = "%Y-%m-%d %H:%M:%SZ"
        logger.emit_value( 'redis', 'slowlog', extra_fields={
            'host': self.display_string,
            'ts': time.strftime( time_format, time.gmtime( entry['start_time'] ) ),
            'exectime' : entry['duration'],
            'command' : command
        } )
        self.last_id = entry['id']
        self.last_timestamp = entry['start_time']
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/redis_monitor.py/RedisHost.log_entry