reactive_graph_runtime_web_impl/
logger_middleware.rs

1use actix_web::middleware::Logger;
2
3use reactive_graph_config_model::GraphQLLoggingConfig;
4
5pub fn get_logger_middleware(graphql_logging_config: &GraphQLLoggingConfig) -> Option<Logger> {
6    if graphql_logging_config.enabled {
7        match &graphql_logging_config.format {
8            Some(format) => Some(Logger::new(format.as_str())),
9            None => Some(Logger::default()),
10        }
11    } else {
12        None
13    }
14}