lib/util/log.py
def format_record_entry(name, length):
            '''
            Formats the entry for `name` by truncating it to a maximum of
            `length` characters. Updates the `record` in place.
            '''
            if not isinstance(name, str):
                if self._debug:
                    logger.error('invalid formattable field: %r', name)
                return
            if not isinstance(length, int):
                if self._debug:
                    logger.error('invalid format field width: %r', length)
                return

            if not hasattr(record, name):
                # name not in it, so nothing to format
                return

            value = getattr(record, name)
            if not isinstance(value, str):
                # not a str, don't format it, it's hard to handle it right...
                if self._debug:
                    logger.warning(
                        'cannot format value for %s: %r', name, value
                    )
                return

            truncated = smart_truncate(value, length)
            if not truncated:
                if self._debug:
                    logger.warning(
                        'failed to truncate value, size: %s, %d',
                        value, length,
                    )
                return

            setattr(record, name, truncated)

            Formats the entry for `name` by truncating it to a maximum of
            `length` characters. Updates the `record` in place.
            
Formats the entry for `name` by truncating it to a maximum of
`length` characters. Updates the `record` in place.
Formats the entry for ` name ` by truncating it to a maximum of ` length ` characters . Updates the ` record ` in place .
def format_record_entry(name, length):
            if not isinstance(name, str):
                if self._debug:
                    logger.error('invalid formattable field: %r', name)
                return
            if not isinstance(length, int):
                if self._debug:
                    logger.error('invalid format field width: %r', length)
                return
            if not hasattr(record, name):
                return
            value = getattr(record, name)
            if not isinstance(value, str):
                if self._debug:
                    logger.warning(
                        'cannot format value for %s: %r', name, value
                    )
                return
            truncated = smart_truncate(value, length)
            if not truncated:
                if self._debug:
                    logger.warning(
                        'failed to truncate value, size: %s, %d',
                        value, length,
                    )
                return
            setattr(record, name, truncated)
def format_record_entry ( name , length ) : if not isinstance ( name , str ) : if self . _debug : logger . error ( 'invalid formattable field: %r' , name ) return if not isinstance ( length , int ) : if self . _debug : logger . error ( 'invalid format field width: %r' , length ) return if not hasattr ( record , name ) : return value = getattr ( record , name ) if not isinstance ( value , str ) : if self . _debug : logger . warning ( 'cannot format value for %s: %r' , name , value ) return truncated = smart_truncate ( value , length ) if not truncated : if self . _debug : logger . warning ( 'failed to truncate value, size: %s, %d' , value , length , ) return setattr ( record , name , truncated )
Formats the entry for `name` by truncating it to a maximum of
`length` characters.
Formats the entry for ` name ` by truncating it to a maximum of ` length ` characters .
'''
            Formats the entry for `name` by truncating it to a maximum of
            `length` characters. Updates the `record` in place.
            ''' # name not in it, so nothing to format # not a str, don't format it, it's hard to handle it right...
name
length