mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
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:
parent
557fd1be24
commit
c05d1eb916
@ -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()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user