feat(response-log): add logging to the response (#1433)

This commit is contained in:
Nishant Joshi
2023-06-14 18:37:17 +05:30
committed by GitHub
parent c9b400e186
commit 96c5efea2b

View File

@ -604,6 +604,7 @@ where
T: Debug,
U: auth::AuthInfo,
A: AppStateInfo,
ApplicationResponse<Q>: Debug,
CustomResult<ApplicationResponse<Q>, E>:
ReportSwitchExt<ApplicationResponse<Q>, api_models::errors::types::ApiErrorResponse>,
{
@ -620,7 +621,10 @@ where
&flow,
)
.await
{
.map(|response| {
logger::info!(api_response =? response);
response
}) {
Ok(ApplicationResponse::Json(response)) => match serde_json::to_string(&response) {
Ok(res) => http_response_json(res),
Err(_) => http_response_err(