feat(logging): replace hardcoded "ERROR" with constant for improved maintainability

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
Balázs Szücs 2025-11-15 16:31:10 +01:00
parent 557fd1be24
commit c05d1eb916

View File

@ -26,6 +26,7 @@ import stirling.software.common.model.ApplicationProperties;
public class ProcessExecutor {
private static final Map<Processes, ProcessExecutor> instances = new ConcurrentHashMap<>();
private static final String ERROR_KEYWORD = "ERROR";
private static ApplicationProperties applicationProperties = new ApplicationProperties();
private final Semaphore semaphore;
private final boolean liveUpdates;
@ -207,7 +208,7 @@ public class ProcessExecutor {
!= null) {
errorLines.add(line);
if (liveUpdates) {
if (line.toUpperCase().contains("ERROR")) {
if (line.toUpperCase().contains(ERROR_KEYWORD)) {
errorDetected.set(true);
}
if (errorDetected.get()) {
@ -239,7 +240,7 @@ public class ProcessExecutor {
!= null) {
outputLines.add(line);
if (liveUpdates) {
if (line.toUpperCase().contains("ERROR")) {
if (line.toUpperCase().contains(ERROR_KEYWORD)) {
errorDetected.set(true);
}
if (errorDetected.get()) {