Skip to content

Commit

Permalink
chore: replace slf4j with java.util.logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jbee committed Nov 28, 2023
1 parent d6b7665 commit 131af77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/hisp/dhis/rules/RuleConditionEvaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
import org.hisp.dhis.rules.models.RuleEvaluationResult;
import org.hisp.dhis.rules.models.RuleValueType;
import org.hisp.dhis.rules.models.TrackerObjectType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

public class RuleConditionEvaluator
{
private static final Logger log = LoggerFactory.getLogger( RuleConditionEvaluator.class.getName() );
private static final Logger log = Logger.getLogger( RuleConditionEvaluator.class.getName() );

public List<RuleEffect> getEvaluatedAndErrorRuleEffects( TrackerObjectType targetType, String targetUid, Map<String, RuleVariableValue> valueMap,
Map<String, List<String>> supplementaryData, List<Rule> rules )
Expand Down Expand Up @@ -59,7 +59,7 @@ public List<RuleEvaluationResult> getRuleEvaluationResults( TrackerObjectType ta

for ( Rule rule : orderRules( rules ) )
{
log.debug( "Evaluating programrule: " + rule.name() );
log.fine( "Evaluating programrule: " + rule.name() );

try {
List<RuleEffect> ruleEffects = new ArrayList<>();
Expand Down Expand Up @@ -101,7 +101,7 @@ public List<RuleEvaluationResult> getRuleEvaluationResults( TrackerObjectType ta

for (RuleEvaluationResult ruleEvaluationResult : ruleEvaluationResults) {

log.debug("Rule " + ruleEvaluationResult.rule().name() + " with id " + ruleEvaluationResult.rule().uid() +
log.fine("Rule " + ruleEvaluationResult.rule().name() + " with id " + ruleEvaluationResult.rule().uid() +
" executed for " + targetType.getName() + "(" + targetUid + ")" +
" with condition (" + ruleEvaluationResult.rule().condition() + ")" +
" was evaluated " + ruleEvaluationResult.evaluatedAs());
Expand Down Expand Up @@ -146,7 +146,7 @@ else if(e instanceof IllegalExpressionException)
" raised an unexpected exception: " + e.getMessage();
}

log.error(errorMessage);
log.log(Level.SEVERE, errorMessage);
ruleEvaluationResults.add(RuleEvaluationResult.errorRule(rule, errorMessage));
}

Expand Down

0 comments on commit 131af77

Please sign in to comment.