MCPcopy Index your code
hub / github.com/python/cpython / log_message

Method log_message

Lib/http/server.py:607–631  ·  view source on GitHub ↗

Log an arbitrary message. This is used by all other logging functions. Override it if you have specific logging wishes. The first argument, FORMAT, is a format string for the message to be logged. If the format string contains any % escapes requiring param

(self, format, *args)

Source from the content-addressed store, hash-verified

605 _control_char_table[ord('\\')] = r'\\'
606
607 def log_message(self, format, *args):
608 """Log an arbitrary message.
609
610 This is used by all other logging functions. Override
611 it if you have specific logging wishes.
612
613 The first argument, FORMAT, is a format string for the
614 message to be logged. If the format string contains
615 any % escapes requiring parameters, they should be
616 specified as subsequent arguments (it's just like
617 printf!).
618
619 The client ip and current date/time are prefixed to
620 every message.
621
622 Unicode control characters are replaced with escaped hex
623 before writing the output to stderr.
624
625 """
626
627 message = format % args
628 sys.stderr.write("%s - - [%s] %s\n" %
629 (self.address_string(),
630 self.log_date_time_string(),
631 message.translate(self._control_char_table)))
632
633 def version_string(self):
634 """Return the server software version string."""

Callers 2

log_requestMethod · 0.95
log_errorMethod · 0.95

Calls 4

address_stringMethod · 0.95
log_date_time_stringMethod · 0.95
writeMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected