pub fn custom<F>(func: F) -> Log<F>
Expand description
Create a wrapping Filter
that receives warp::log::Info
.
§Example
use warp::Filter;
let log = warp::log::custom(|info| {
// Use a log macro, or slog, or println, or whatever!
eprintln!(
"{} {} {}",
info.method(),
info.path(),
info.status(),
);
});
let route = warp::any()
.map(warp::reply)
.with(log);