pub fn log(name: &'static str) -> Log<impl Fn(Info<'_>) + Copy>
Expand description
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);