Skip to content

Commit 93e0a5e

Browse files
authored
Set tabular modification failure log level to error instead of warn (#130)
Signed-off-by: Hugo Marcellin <[email protected]>
1 parent ac4fb64 commit 93e0a5e

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/main/java/org/gridsuite/modification/modifications/tabular/AbstractTabularModification.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ public void apply(Network network, ReportNode subReportNode) {
5555
applicationFailuresCount++;
5656
ReportNode errorReportNode = modifReportNode.newReportNode()
5757
.withMessageTemplate(baseTemplateMessage() + ".error.equipmentError")
58-
.withSeverity(TypedValue.WARN_SEVERITY)
58+
.withSeverity(TypedValue.ERROR_SEVERITY)
5959
.add();
6060
errorReportNode.newReportNode()
6161
.withMessageTemplate(baseTemplateMessage() + ".exception")
6262
.withUntypedValue("message", e.getMessage())
63-
.withSeverity(TypedValue.WARN_SEVERITY)
63+
.withSeverity(TypedValue.ERROR_SEVERITY)
6464
.add();
6565
LOGGER.warn(e.getMessage());
6666
}
@@ -73,11 +73,11 @@ public void apply(Network network, ReportNode subReportNode) {
7373
.add();
7474
} else if (applicationFailuresCount > 0) {
7575
subReportNode.newReportNode()
76-
.withMessageTemplate(baseTemplateMessage() + ".warning")
76+
.withMessageTemplate(baseTemplateMessage() + ".partial")
7777
.withUntypedValue("modificationsCount", modificationInfos.getModifications().size() - applicationFailuresCount)
7878
.withUntypedValue("failuresCount", applicationFailuresCount)
7979
.withUntypedValue(DEFAULT_MESSAGE_KEY, defaultMessage())
80-
.withSeverity(TypedValue.WARN_SEVERITY)
80+
.withSeverity(TypedValue.ERROR_SEVERITY)
8181
.add();
8282
} else {
8383
subReportNode.newReportNode()

src/main/resources/org/gridsuite/modification/reports.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@ network.modification.tabular.creation.error = Tabular creation: No ${defaultMess
280280
network.modification.tabular.creation.exception = ${message}
281281
network.modification.tabular.creation.equipmentId = Creation of ${equipmentId}
282282
network.modification.tabular.creation.error.equipmentError = Creation errors
283-
network.modification.tabular.creation.warning = Tabular creation: ${modificationsCount} ${defaultMessage} and ${failuresCount} have not been created
283+
network.modification.tabular.creation.partial = Tabular creation: ${modificationsCount} ${defaultMessage} and ${failuresCount} have not been created
284284
network.modification.tabular.modification = Tabular modification: ${modificationsCount} ${defaultMessage}
285285
network.modification.tabular.modification.error = Tabular modification: No ${defaultMessage}
286286
network.modification.tabular.modification.exception = ${message}
287287
network.modification.tabular.modification.equipmentId = Modification of ${equipmentId}
288288
network.modification.tabular.modification.error.equipmentError = Modification errors
289-
network.modification.tabular.modification.warning = Tabular modification: ${modificationsCount} ${defaultMessage} and ${failuresCount} have not been modified
289+
network.modification.tabular.modification.partial = Tabular modification: ${modificationsCount} ${defaultMessage} and ${failuresCount} have not been modified
290290
network.modification.tabular.modification.shuntCompensator.maxSusceptanceIgnored.1 = Tabular modification: Input for maximum susceptance has been ignored since it is not possible to simultaneously update type, maximum reactive power and maximum susceptance for shunt compensator with id ${id}
291291
network.modification.tabular.modification.shuntCompensator.maxSusceptanceIgnored.2 = Tabular modification: Input for maximum susceptance has been ignored since it is not possible to simultaneously update type and maximum susceptance for shunt compensator with id ${id}
292292
network.modification.tabular.modification.shuntCompensator.maxSusceptanceIgnored.3 = Tabular modification: Input for maximum susceptance has been ignored since it is not possible to simultaneously update maximum reactive power and maximum susceptance for shunt compensator with id ${id}

src/test/java/org/gridsuite/modification/modifications/tabularmodifications/TabularBatteryModificationsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private void assertAfterNetworkModificationApplication(ReportNode reportNode) {
7373
assertLogNthMessage("Modification of v1Battery", "network.modification.tabular.modification.equipmentId", reportNode, 1);
7474
assertLogNthMessage("Modification of v2Battery", "network.modification.tabular.modification.equipmentId", reportNode, 2);
7575
assertLogNthMessage("Modification of v3Battery", "network.modification.tabular.modification.equipmentId", reportNode, 3);
76-
assertLogMessageWithoutRank("Tabular modification: 3 batteries have been modified and 1 have not been modified", "network.modification.tabular.modification.warning", reportNode);
76+
assertLogMessageWithoutRank("Tabular modification: 3 batteries have been modified and 1 have not been modified", "network.modification.tabular.modification.partial", reportNode);
7777
}
7878

7979
@Override

src/test/java/org/gridsuite/modification/modifications/tabularmodifications/TabularGeneratorModificationsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void assertAfterNetworkModificationApplication(ReportNode reportNode) {
7474
assertLogNthMessage("Modification of idGenerator", "network.modification.tabular.modification.equipmentId", reportNode, 1);
7575
assertLogNthMessage("Modification of v5generator", "network.modification.tabular.modification.equipmentId", reportNode, 2);
7676
assertLogNthMessage("Modification of v6generator", "network.modification.tabular.modification.equipmentId", reportNode, 3);
77-
assertLogMessageWithoutRank("Tabular modification: 3 generators have been modified and 1 have not been modified", "network.modification.tabular.modification.warning", reportNode);
77+
assertLogMessageWithoutRank("Tabular modification: 3 generators have been modified and 1 have not been modified", "network.modification.tabular.modification.partial", reportNode);
7878
}
7979

8080
@Test

src/test/java/org/gridsuite/modification/modifications/tabularmodifications/TabularLineModificationsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private void assertAfterNetworkModificationApplication(ReportNode reportNode) {
7676
assertLogNthMessage("Modification of line2", "network.modification.tabular.modification.equipmentId", reportNode, 2);
7777
assertLogNthMessage("Modification of line3", "network.modification.tabular.modification.equipmentId", reportNode, 3);
7878
assertLogNthMessage("Modification of line3", "network.modification.tabular.modification.equipmentId", reportNode, 4);
79-
assertLogMessageWithoutRank("Tabular modification: 4 lines have been modified and 1 have not been modified", "network.modification.tabular.modification.warning", reportNode);
79+
assertLogMessageWithoutRank("Tabular modification: 4 lines have been modified and 1 have not been modified", "network.modification.tabular.modification.partial", reportNode);
8080
}
8181

8282
@Override

src/test/java/org/gridsuite/modification/modifications/tabularmodifications/TabularTwoWindingsTransformerModificationsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private void assertAfterNetworkModificationApplication(ReportNode reportNode) {
7676
assertAfterNetworkModificationApplication();
7777
assertLogNthMessage("Modification of trf1", "network.modification.tabular.modification.equipmentId", reportNode, 1);
7878
assertLogNthMessage("Modification of trf2", "network.modification.tabular.modification.equipmentId", reportNode, 2);
79-
assertLogMessageWithoutRank("Tabular modification: 2 two windings transformers have been modified and 1 have not been modified", "network.modification.tabular.modification.warning", reportNode);
79+
assertLogMessageWithoutRank("Tabular modification: 2 two windings transformers have been modified and 1 have not been modified", "network.modification.tabular.modification.partial", reportNode);
8080
}
8181

8282
@Override

0 commit comments

Comments
 (0)