소스 검색

Remove string formatting in logger

Baglio Tabifata 4 년 전
부모
커밋
1404fc7e9c

+ 4 - 4
src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALAnalyzer.java

@@ -34,7 +34,7 @@ public class DuPALAnalyzer {
         int maxINVal = 1 << (dpci.palSpecs.getPinCount_IN() + dpci.palSpecs.getPinCount_IO());
 
         logger.info("detectIOTypeMask -> Starting IO type detection... This could take a while.");
-        logger.info("detectIOTypeMask -> Highest address for input pins: " + String.format("%06X", maxINVal-1));
+        logger.info("detectIOTypeMask -> Highest address for input pins: %06X", maxINVal-1);
 
         for(int idx = 0; idx < maxINVal; idx++) {
 
@@ -56,12 +56,12 @@ public class DuPALAnalyzer {
 
                 ioAsOutMask |= (pinstat ^ BitUtils.scatterBitField((sub_idx >> dpci.palSpecs.getPinCount_IN()), dpci.palSpecs.getMask_IO_R())) & dpci.palSpecs.getMask_IO_R();
                 
-                logger.info(String.format("detectIOTypeMask -> idx: C(%06X) -> S(%06X) | M[%06X]", sub_idx, sub_writeAddr, ioAsOutMask));
+                logger.info("detectIOTypeMask -> idx: C(%06X) -> S(%06X) | M[%06X]", sub_idx, sub_writeAddr, ioAsOutMask);
             }
 
             if(dpci.palSpecs.getPinCount_RO() == 0) break; // No need to try multiple registered states
 
-            logger.info("detectIOTypeMask -> Pulsing clock with address " + String.format("%06X", writeAddr));
+            logger.info("detectIOTypeMask -> Pulsing clock with address %06X", writeAddr);
             dpci.writeAndPulseClock(writeAddr);
         }
 
@@ -99,7 +99,7 @@ public class DuPALAnalyzer {
             } else { // Either registered, or with feedbacks
                 if(ioAsOutMask < 0) {
                     ioAsOutMask = detectIOTypeMask(dpci);
-                    logger.info("startAnalisys() -> Detected the following IO Type mask: " + String.format("%06X", ioAsOutMask));
+                    logger.info("startAnalisys() -> Detected the following IO Type mask: %06X", ioAsOutMask);
                 }
                 
                 OutState[] osArray = OSExplorer.exploreOutStates(dpci, ioAsOutMask);

+ 2 - 2
src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALCmdInterface.java

@@ -59,7 +59,7 @@ public class DuPALCmdInterface {
         res = DuPALProto.handleWRITEResponse(dpm.readResponse());
 
         if(res < 0) {
-            logger.error("write("+String.format("%08X", data)+") -> FAILED!");
+            logger.error("write(%08X) -> FAILED!", data);
             throw new DuPALBoardException("write("+String.format("%08X", data)+") command failed!");
         }
 
@@ -75,7 +75,7 @@ public class DuPALCmdInterface {
             write(data_clk);
             write(data_noclk);
         } catch(DuPALBoardException e) {
-            logger.error("Pulsing clock to insert data " + String.format("%06X", data) + " failed.");
+            logger.error("Pulsing clock to insert data %06X failed.", data);
             throw e;
         }
 

+ 2 - 2
src/main/java/info/hkzlab/dupal/analyzer/palanalisys/explorers/OSExplorer.java

@@ -54,7 +54,7 @@ public class OSExplorer {
                     cur_hiz = (pins ^ read_forced) & (pSpecs.getMask_O_R() | ioAsOutMask);
 
                     if((pins != expected_pins) || (curState.pins.hiz != cur_hiz)) {
-                        logger.error("exploreOutStates() -> Mismatch in expected pins ("+String.format("E:%02X|%02X - A:%02X|%02X", expected_pins, curState.pins.hiz, pins, cur_hiz)+") after walking path to state " + curState);
+                        logger.error("exploreOutStates() -> Mismatch in expected pins (E:%02X|%02X - A:%02X|%02X) after walking path to state " + curState, expected_pins, curState.pins.hiz, pins, cur_hiz);
                         throw new DuPALAnalyzerException("exploreOutStates() -> Mismatch in expected pins after walking to state " + curState);
                     }
                     continue; // Loop again
@@ -122,7 +122,7 @@ public class OSExplorer {
             int newMask = BitUtils.scatterBitField(io_in_r, pSpecs.getMask_IO_R() ^ BitUtils.scatterBitField(io_in_w, pSpecs.getMask_IO_R()));
             newMask |= ioAsOutMask;
 
-            logger.error("An IO pin marked as input is behaving as an output. New IO mask: " + String.format("%02X", newMask));
+            logger.error("An IO pin marked as input is behaving as an output. New IO mask: %02X", newMask);
             throw new DuPALAnalyzerException("IO pin marked as input is behaving as output.");
         }