Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demote some logs #739

Merged
merged 4 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private Map<State, OptimizationResult> optimizeContingencyScenarios(Crac crac,
contingencyScenarioResults.put(curativeState, new SkippedOptimizationResultImpl(curativeState, new HashSet<>(), new HashSet<>(), ComputationStatus.FAILURE));
}
}
TECHNICAL_LOGS.info("Remaining post-contingency scenarios to optimize: {}", remainingScenarios.decrementAndGet());
TECHNICAL_LOGS.debug("Remaining post-contingency scenarios to optimize: {}", remainingScenarios.decrementAndGet());
try {
networkPool.releaseUsedNetwork(networkClone);
contingencyCountDownLatch.countDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.Set;
import java.util.stream.Collectors;

import static com.farao_community.farao.commons.logs.FaraoLoggerProvider.BUSINESS_WARNS;
import static com.farao_community.farao.commons.logs.FaraoLoggerProvider.TECHNICAL_LOGS;

/**
* @author Joris Mancini {@literal <joris.mancini at rte-france.com>}
Expand Down Expand Up @@ -109,20 +109,20 @@ private static Map<FlowCnec, PstRangeAction> getUnoptimizedCnecsInSeriesWithPsts

private static boolean skipEntry(String cnecId, String pstId, Set<FlowCnec> flowCnecs, Set<PstRangeAction> pstRangeActions) {
if (flowCnecs.isEmpty()) {
BUSINESS_WARNS.warn("No flowCnec with network element id {} exists in unoptimized-cnecs-in-series-with-psts parameter", cnecId);
TECHNICAL_LOGS.debug("No flowCnec with network element id {} exists in unoptimized-cnecs-in-series-with-psts parameter", cnecId);
return true;
}

if (pstRangeActions.isEmpty()) {
BUSINESS_WARNS.warn("No pst range actions are defined with network element {}", pstId);
TECHNICAL_LOGS.debug("No pst range actions are defined with network element {}", pstId);
return true;
}
return false;
}

private static boolean skipFlowCnec(Set<PstRangeAction> availablePstRangeActions, String pstId) {
if (availablePstRangeActions.size() > 1) {
BUSINESS_WARNS.warn("{} pst range actions are defined with network element {} instead of 1", availablePstRangeActions.size(), pstId);
TECHNICAL_LOGS.debug("{} pst range actions are defined with network element {} instead of 1", availablePstRangeActions.size(), pstId);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import com.farao_community.farao.data.crac_api.range_action.PstRangeAction;
import com.farao_community.farao.search_tree_rao.commons.RaoUtil;
import com.farao_community.farao.search_tree_rao.commons.optimization_perimeters.OptimizationPerimeter;
import com.farao_community.farao.search_tree_rao.linear_optimisation.algorithms.linear_problem.LinearProblem;
import com.farao_community.farao.search_tree_rao.commons.parameters.UnoptimizedCnecParameters;
import com.farao_community.farao.search_tree_rao.linear_optimisation.algorithms.linear_problem.LinearProblem;
import com.farao_community.farao.search_tree_rao.result.api.FlowResult;
import com.farao_community.farao.search_tree_rao.result.api.RangeActionActivationResult;
import com.farao_community.farao.search_tree_rao.result.api.SensitivityResult;
Expand All @@ -26,7 +26,6 @@
import java.util.stream.Collectors;

import static com.farao_community.farao.commons.Unit.MEGAWATT;
import static com.farao_community.farao.commons.logs.FaraoLoggerProvider.BUSINESS_WARNS;
import static java.lang.Math.abs;

/**
Expand Down Expand Up @@ -315,7 +314,7 @@ private State getLastStateWithRangeActionAvailableForCnec(FlowCnec cnec) {
optimizationContext.getRangeActionsPerState().get(state).contains(flowCnecPstRangeActionMap.get(cnec)))
.findFirst();
if (lastState.isEmpty()) {
BUSINESS_WARNS.warn("Range action {} is unavailable for cnec {}", flowCnecPstRangeActionMap.get(cnec).getId(), cnec.getId());
// Range action (referenced for "cnec" in flowCnecPstRangeActionMap) is unavailable for cnec
return null;
} else {
return lastState.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public CompletableFuture<OptimizationResult> run() {

applyForcedNetworkActionsOnRootLeaf();

TECHNICAL_LOGS.info("Evaluating root leaf");
TECHNICAL_LOGS.debug("Evaluating root leaf");
rootLeaf.evaluate(input.getObjectiveFunction(), getSensitivityComputerForEvaluation());
this.preOptimFunctionalCost = rootLeaf.getFunctionalCost();
this.preOptimVirtualCost = rootLeaf.getVirtualCost();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ public void testLogsVerbose() {
when(rootLeaf.toString()).thenReturn("root leaf description");
Mockito.doReturn(rootLeaf).when(searchTree).makeLeaf(optimizationPerimeter, network, prePerimeterResult, appliedRemedialActions);

String expectedLog1 = "[INFO] Evaluating root leaf";
String expectedLog1 = "[DEBUG] Evaluating root leaf";
String expectedLog2 = "[INFO] Could not evaluate leaf: root leaf description";
String expectedLog3 = "[INFO] Scenario \"preventive\": initial cost = 0.00 (functional: 0.00, virtual: 0.00), no remedial actions activated, cost after PRA = 0.00 (functional: 0.00, virtual: 0.00)";

Expand All @@ -471,7 +471,7 @@ public void testLogsDontVerbose() {
when(rootLeaf.toString()).thenReturn("root leaf description");
Mockito.doReturn(rootLeaf).when(searchTree).makeLeaf(optimizationPerimeter, network, prePerimeterResult, appliedRemedialActions);

String expectedLog1 = "[INFO] Evaluating root leaf";
String expectedLog1 = "[DEBUG] Evaluating root leaf";
String expectedLog2 = "[INFO] Could not evaluate leaf: root leaf description";
String expectedLog3 = "[INFO] Scenario \"preventive\": initial cost = 0.00 (functional: 0.00, virtual: 0.00), no remedial actions activated, cost after PRA = 0.00 (functional: 0.00, virtual: 0.00)";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ protected MultipleNetworkPool(Network network, String targetVariant, int paralle

@Override
protected void initAvailableNetworks(Network network) {
TECHNICAL_LOGS.info("Filling network pool with copies of network '{}' on variant '{}'", network.getId(), targetVariant);
TECHNICAL_LOGS.debug("Filling network pool with copies of network '{}' on variant '{}'", network.getId(), targetVariant);
String initialVariant = network.getVariantManager().getWorkingVariantId();
network.getVariantManager().setWorkingVariant(targetVariant);
for (int i = 0; i < getParallelism(); i++) {
TECHNICAL_LOGS.info("Copy n°{}", i + 1);
TECHNICAL_LOGS.debug("Copy n°{}", i + 1);
Network copy = NetworkXml.copy(network);
// The initial network working variant is VariantManagerConstants.INITIAL_VARIANT_ID
// in cloned network, so we need to copy it again.
Expand Down