MCPcopy Index your code
hub / github.com/RustPython/RustPython / log_message

Method log_message

Lib/http/server.py:635–659  ·  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

633 _control_char_table[ord('\\')] = r'\\'
634
635 def log_message(self, format, *args):
636 """Log an arbitrary message.
637
638 This is used by all other logging functions. Override
639 it if you have specific logging wishes.
640
641 The first argument, FORMAT, is a format string for the
642 message to be logged. If the format string contains
643 any % escapes requiring parameters, they should be
644 specified as subsequent arguments (it's just like
645 printf!).
646
647 The client ip and current date/time are prefixed to
648 every message.
649
650 Unicode control characters are replaced with escaped hex
651 before writing the output to stderr.
652
653 """
654
655 message = format % args
656 sys.stderr.write("%s - - [%s] %s\n" %
657 (self.address_string(),
658 self.log_date_time_string(),
659 message.translate(self._control_char_table)))
660
661 def version_string(self):
662 """Return the server software version string."""

Callers 3

log_requestMethod · 0.95
log_errorMethod · 0.95
run_cgiMethod · 0.45

Calls 4

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

Tested by

no test coverage detected