Function warp::filters::log::log[][src]

pub fn log(
    name: &'static str
) -> Log<impl Fn(Info) + Copy>

Create a wrapping filter with the specified name as the target.

This uses the default access logging format, and log records produced will have their target set to name.

Example

use warp::Filter;

// If using something like `pretty_env_logger`,
// view logs by setting `RUST_LOG=example::api`.
let log = warp::log("example::api");
let route = warp::any()
    .map(warp::reply)
    .with(log);