Skip to content

Commit

Permalink
chore: run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperswitch-bot[bot] committed Feb 8, 2024
1 parent aaca947 commit ab5f8b5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
16 changes: 13 additions & 3 deletions crates/router/src/core/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ use crate::{
};

#[allow(clippy::too_many_arguments, clippy::type_complexity)]
#[instrument(skip_all, fields(payment_id, merchant_id, connector_name, payment_method))]
#[instrument(
skip_all,
fields(payment_id, merchant_id, connector_name, payment_method)
)]
pub async fn payments_operation_core<F, Req, Op, FData, Ctx>(
state: &AppState,
merchant_account: domain::MerchantAccount,
Expand Down Expand Up @@ -470,8 +473,15 @@ where
.map_err(|error| logger::warn!(payments_outgoing_webhook_error=?error))
.ok();

let connector_name = payment_data.payment_attempt.connector.clone().unwrap_or_default();
let pmt = payment_data.payment_attempt.payment_method.unwrap_or_default();
let connector_name = payment_data
.payment_attempt
.connector
.clone()
.unwrap_or_default();
let pmt = payment_data
.payment_attempt
.payment_method
.unwrap_or_default();

tracing::Span::current().record("connector_name", connector_name);
tracing::Span::current().record("payment_method", pmt.to_string());
Expand Down
3 changes: 2 additions & 1 deletion crates/router/src/core/webhooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub mod types;
pub mod utils;

use std::{str::FromStr, time::Instant};
use tracing_futures::Instrument;

use actix_web::FromRequest;
use api_models::{
payments::HeaderPayload,
Expand All @@ -12,6 +12,7 @@ use common_utils::{errors::ReportSwitchExt, events::ApiEventsType, request::Requ
use error_stack::{report, IntoReport, ResultExt};
use masking::ExposeInterface;
use router_env::{instrument, tracing, tracing_actix_web::RequestId};
use tracing_futures::Instrument;

use super::{errors::StorageErrorExt, metrics};
#[cfg(feature = "stripe")]
Expand Down
8 changes: 7 additions & 1 deletion crates/router_env/src/logger/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ impl Visit for Storage<'_> {
}
}

const PERSISTENT_KEYS: [&str; 5] = ["payment_id", "connector_name", "merchant_id", "flow", "payment_method"];
const PERSISTENT_KEYS: [&str; 5] = [
"payment_id",
"connector_name",
"merchant_id",
"flow",
"payment_method",
];

impl<S: Subscriber + for<'a> tracing_subscriber::registry::LookupSpan<'a>> Layer<S>
for StorageSubscription
Expand Down

0 comments on commit ab5f8b5

Please sign in to comment.