MCPcopy
hub / github.com/Gallopsled/pwntools / format

Method format

pwnlib/log.py:618–646  ·  view source on GitHub ↗
(self, record)

Source from the content-addressed store, hash-verified

616 nlindent = '\n' + indent
617
618 def format(self, record):
619 # use the default formatter to actually format the record
620 msg = super(Formatter, self).format(record)
621
622 # then put on a prefix symbol according to the message type
623
624 msgtype = getattr(record, 'pwnlib_msgtype', None)
625
626 # if 'pwnlib_msgtype' is not set (or set to `None`) we just return the
627 # message as it is
628 if msgtype is None:
629 return msg
630
631 if msgtype in _msgtype_prefixes:
632 style, symb = _msgtype_prefixes[msgtype]
633 prefix = '[%s] ' % style(symb)
634 elif msgtype == 'indented':
635 prefix = self.indent
636 elif msgtype == 'animated':
637 # the handler will take care of updating the spinner, so we will
638 # not include it here
639 prefix = ''
640 else:
641 # this should never happen
642 prefix = '[?] '
643
644 msg = prefix + msg
645 msg = self.nlindent.join(msg.splitlines())
646 return msg
647
648def _need_text(s):
649 # circular import wrapper

Callers 15

asmFunction · 0.80
emitMethod · 0.80
binaryFunction · 0.80
provider_libcdbFunction · 0.80
query_libc_ripFunction · 0.80
unstrip_libcFunction · 0.80
initFunction · 0.80
term.pyFile · 0.80
__repr__Method · 0.80
load_constants.pyFile · 0.80
generate_oneFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected