mirror of
https://github.com/actix/actix-extras.git
synced 2024-12-01 02:44:37 +01:00
update logger doc string
This commit is contained in:
parent
7198dde465
commit
187644e178
@ -13,6 +13,9 @@ use httpresponse::HttpResponse;
|
|||||||
use middleware::{Middleware, Started, Finished};
|
use middleware::{Middleware, Started, Finished};
|
||||||
|
|
||||||
/// `Middleware` for logging request and response info to the terminal.
|
/// `Middleware` for logging request and response info to the terminal.
|
||||||
|
/// `Logger` middleware uses standard log crate to log information. You should
|
||||||
|
/// enable logger for *actix_web* package to see access log.
|
||||||
|
/// ([env_logger](https://docs.rs/env_logger/*/env_logger/) or similar)
|
||||||
///
|
///
|
||||||
/// ## Usage
|
/// ## Usage
|
||||||
///
|
///
|
||||||
@ -24,10 +27,14 @@ use middleware::{Middleware, Started, Finished};
|
|||||||
/// ```
|
/// ```
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # extern crate actix_web;
|
/// # extern crate actix_web;
|
||||||
|
/// extern crate env_logger;
|
||||||
/// use actix_web::Application;
|
/// use actix_web::Application;
|
||||||
/// use actix_web::middleware::Logger;
|
/// use actix_web::middleware::Logger;
|
||||||
///
|
///
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
|
/// std::env::set_var("RUST_LOG", "actix_web=info");
|
||||||
|
/// env_logger::init();
|
||||||
|
///
|
||||||
/// let app = Application::new()
|
/// let app = Application::new()
|
||||||
/// .middleware(Logger::default())
|
/// .middleware(Logger::default())
|
||||||
/// .middleware(Logger::new("%a %{User-Agent}i"))
|
/// .middleware(Logger::new("%a %{User-Agent}i"))
|
||||||
|
Loading…
Reference in New Issue
Block a user