From 9150bc35450cc9d3cf93be239ea7dbe108d508bc Mon Sep 17 00:00:00 2001 From: ttt161 <45654208+ttt161@users.noreply.github.com> Date: Tue, 6 Jun 2023 12:58:40 +0300 Subject: [PATCH] TD-621: add logging for rejected routes (#32) * TD-621: add logging for rejected routes * TD-621: fix issue --------- Co-authored-by: anatoliy.losev --- .gitignore | 1 + apps/party_management/src/pm_ruleset.erl | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index 7557112..9fc91b1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ rebar3.crashdump /.idea/ *.beam tags +*.iml # make stuff /.image.* diff --git a/apps/party_management/src/pm_ruleset.erl b/apps/party_management/src/pm_ruleset.erl index 71706b3..70f1c2e 100644 --- a/apps/party_management/src/pm_ruleset.erl +++ b/apps/party_management/src/pm_ruleset.erl @@ -15,6 +15,12 @@ -spec reduce_payment_routing_ruleset(payment_routing_ruleset(), varset(), domain_revision()) -> payment_routing_ruleset(). reduce_payment_routing_ruleset(RuleSet, VS, DomainRevision) -> + logger:log( + info, + "Routing start reduce ruleset with varset: ~p", + [VS], + logger:get_process_metadata() + ), RuleSet#domain_RoutingRuleset{ decisions = reduce_payment_routing_decisions(RuleSet#domain_RoutingRuleset.decisions, VS, DomainRevision) }. @@ -31,6 +37,12 @@ reduce_payment_routing_delegates([D | Delegates], VS, Rev) -> RuleSetRef = D#domain_RoutingDelegate.ruleset, case pm_selector:reduce_predicate(Predicate, VS, Rev) of ?const(false) -> + logger:log( + info, + "Routing delegate rejected. Delegate: ~p~nPredicate: ~p", + [D, Predicate], + logger:get_process_metadata() + ), reduce_payment_routing_delegates(Delegates, VS, Rev); ?const(true) -> #domain_RoutingRuleset{ @@ -52,6 +64,12 @@ reduce_payment_routing_candidates(Candidates, VS, Rev) -> Predicate = C#domain_RoutingCandidate.allowed, case pm_selector:reduce_predicate(Predicate, VS, Rev) of ?const(false) -> + logger:log( + info, + "Routing candidate rejected. Candidate: ~p~nPredicate: ~p", + [C, Predicate], + logger:get_process_metadata() + ), AccIn; ?const(true) = ReducedPredicate -> ReducedCandidate = C#domain_RoutingCandidate{