Struct rapid_web::logger::RapidLogger
source · pub struct RapidLogger { /* private fields */ }Implementations§
source§impl RapidLogger
impl RapidLogger
Simple Middleware for logging request and response summaries to the console/terminal.
This middleware uses the log crate to output its logs and is enabled by default but can optionally be turned off as needed
The RapidLogger has 3 different logging formats/variants
RapidLogger::minimalRapidLogger::detailedRapidLogger::verbose
Example output
[rapid-web::logger] REQUEST GET /get-todos HTTP/1.1
Trait Implementations§
source§impl<S, B> Transform<S, ServiceRequest> for RapidLoggerwhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
S::Future: 'static,
B: 'static,
impl<S, B> Transform<S, ServiceRequest> for RapidLoggerwhere S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>, S::Future: 'static, B: 'static,
§type Response = ServiceResponse<B>
type Response = ServiceResponse<B>
Responses produced by the service.
§type Transform = RapidLoggerMiddleware<S>
type Transform = RapidLoggerMiddleware<S>
The
TransformService value created by this factory§type Future = Ready<Result<<RapidLogger as Transform<S, ServiceRequest>>::Transform, <RapidLogger as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<RapidLogger as Transform<S, ServiceRequest>>::Transform, <RapidLogger as Transform<S, ServiceRequest>>::InitError>>
The future response value.
source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously