Skip to main content

Module formatters

Module formatters 

Source
Available on crate feature client only.
Expand description

Building-block formatters for ClientLogger.

Compose them into tuples to build a full log line. The default top-level format is dev_formatter.

Functions§

body_len_human
Formatter for the response Content-Length as a human-readable string (5 bytes, 10.1 kb). Produces - if no Content-Length is set.
bytes
Formatter for the response Content-Length as a raw byte count, 0 if unknown.
dev_formatter
The default development-mode formatter.
error
Formatter for the transport-level error stashed on the conn, if any.
method
Formatter for the conn’s HTTP method.
request_header
Formatter-builder for a particular request header, wrapped in quotes. Produces "" if the header is not present.
response_header
Formatter-builder for a particular response header, wrapped in quotes. Produces "" if the header is not present.
response_time
Formatter for the wall-clock duration between when ClientLogger first ran and when the log line is rendered.
secure
Formatter for whether the request used a TLS-bearing scheme (https/wss).
status
Formatter for the HTTP response status.
timestamp
Formatter for the current timestamp at log-write time (apache format, 10/Oct/2000:13:55:36 -0700).
url
Formatter for the full request URL (scheme, host, path, query).
version
Formatter for the HTTP version used on the wire.