From 82401b4c30846fb7cbd2aaaead3cbfbcd1d2ec78 Mon Sep 17 00:00:00 2001 From: Bernadette Date: Wed, 15 May 2024 11:46:56 -0500 Subject: [PATCH 1/2] remove extra logs --- .../devicemanager/components/scanner/ScannerDevice.java | 4 ++-- .../devicemanager/components/scanner/ScannerManager.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java b/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java index 7b3d2e1..a09bab0 100644 --- a/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java +++ b/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java @@ -217,7 +217,7 @@ protected void enable() throws JposException { LOGGER.trace(getScannerType() + "enable(in)"); if (!isConnected()) { JposException jposException = new JposException(JposConst.JPOS_E_OFFLINE); - LOGGER.error(getScannerType() + " Failed to Connect Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); + //LOGGER.error(getScannerType() + " Failed to Connect Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); throw jposException; } deviceListener.startEventListeners(); @@ -268,7 +268,7 @@ private void disable() throws JposException { } catch (JposException jposException) { if(isConnected()) { LOGGER.error(MARKER, getScannerType() + " Failed to Disable Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); - } else { + } else if(jposException.getErrorCode() != JposConst.JPOS_E_CLOSED) { LOGGER.error(getScannerType() + " Failed to Disable Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); } if(getScannerType().equalsIgnoreCase("HANDHELD")) { diff --git a/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java b/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java index d1c18b2..954e791 100644 --- a/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java +++ b/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java @@ -63,6 +63,11 @@ public void connect() { scanners.forEach(ScannerDevice::connect); if (connectStatus == ConnectEnum.FIRST_CONNECT) { + for (ScannerDevice scanner : scanners) { + if(!scanner.isConnected()) { + LOGGER.error(scanner.getScannerType() + " Failed to Connect"); + } + } connectStatus = ConnectEnum.CHECK_HEALTH; } } From 0a24072d461b1df322b5f31044524a477755b43f Mon Sep 17 00:00:00 2001 From: Bernadette Date: Wed, 15 May 2024 11:48:32 -0500 Subject: [PATCH 2/2] remove extra logs --- .../target/devicemanager/components/scanner/ScannerDevice.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java b/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java index a09bab0..682bdf6 100644 --- a/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java +++ b/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java @@ -217,7 +217,6 @@ protected void enable() throws JposException { LOGGER.trace(getScannerType() + "enable(in)"); if (!isConnected()) { JposException jposException = new JposException(JposConst.JPOS_E_OFFLINE); - //LOGGER.error(getScannerType() + " Failed to Connect Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); throw jposException; } deviceListener.startEventListeners();