Skip to main content

reads_response_body

Function reads_response_body 

Source
pub fn reads_response_body(
    log_format: Option<&HashMap<String, LogFormatValue>>,
    include_resp_body: bool,
) -> bool
Expand description

Whether a logger with this configuration reads context.response.body.

A logger opts out of buffering only when it has a log_format whose entries never reference the response body and it was not asked to include the body outright.

With no log_format it falls through to build_default, which always records size: ctx.response.body.len(). On a streaming route that would silently log 0, so the absent-format case keeps buffering rather than trading a correct byte count for a stream.