@@ -107,7 +107,7 @@ private CardTerminal createMonitoringTerminal(String terminalName) {
107107 if (t .getName ().equals (terminalName )) {
108108 if (logger .isDebugEnabled ()) {
109109 logger .debug (
110- "Reader [{}]: created separate monitoring context for improved Linux compatibility" ,
110+ "[{}] creating separate monitoring context for improved Linux compatibility" ,
111111 terminalName );
112112 }
113113 return t ;
@@ -116,14 +116,14 @@ private CardTerminal createMonitoringTerminal(String terminalName) {
116116
117117 // Terminal not found in new context, fall back to same terminal
118118 logger .warn (
119- "Reader [{}]: could not find terminal in separate context, using shared context (may cause issues on Linux)" ,
119+ "[{}] could not find terminal in separate context, using shared context (may cause issues on Linux)" ,
120120 terminalName );
121121 return communicationTerminal ;
122122
123123 } catch (Exception e ) {
124124 // Failed to create separate context, fall back to same terminal
125125 logger .warn (
126- "Reader [{}]: could not create separate monitoring context ({}) , using shared context (may cause issues on Linux)" ,
126+ "[{}] could not create separate monitoring context [reason={}] , using shared context (may cause issues on Linux)" ,
127127 terminalName ,
128128 e .getMessage ());
129129 return communicationTerminal ;
@@ -140,7 +140,7 @@ public void waitForCardInsertion() throws TaskCanceledException, ReaderIOExcepti
140140
141141 if (logger .isTraceEnabled ()) {
142142 logger .trace (
143- "Reader [{}]: start waiting card insertion (loop latency: {} ms)" ,
143+ "[{}] start waiting card insertion (loop latency: {} ms)... " ,
144144 getName (),
145145 cardMonitoringCycleDuration );
146146 }
@@ -153,7 +153,7 @@ public void waitForCardInsertion() throws TaskCanceledException, ReaderIOExcepti
153153 if (monitoringTerminal .waitForCardPresent (cardMonitoringCycleDuration )) {
154154 // card inserted
155155 if (logger .isTraceEnabled ()) {
156- logger .trace ("Reader [{}]: card inserted" , getName ());
156+ logger .trace ("[{}] card inserted" , getName ());
157157 }
158158 return ;
159159 }
@@ -162,7 +162,7 @@ public void waitForCardInsertion() throws TaskCanceledException, ReaderIOExcepti
162162 }
163163 }
164164 if (logger .isTraceEnabled ()) {
165- logger .trace ("Reader [{}]: waiting card insertion stopped" , getName ());
165+ logger .trace ("[{}] waiting card insertion stopped" , getName ());
166166 }
167167 } catch (CardException e ) {
168168 // here, it is a communication failure with the reader
@@ -201,8 +201,7 @@ public boolean isProtocolSupported(String readerProtocol) {
201201 @ Override
202202 public void activateProtocol (String readerProtocol ) {
203203 if (logger .isTraceEnabled ()) {
204- logger .trace (
205- "Reader [{}]: activating protocol [{}] takes no action" , getName (), readerProtocol );
204+ logger .trace ("[{}] activating protocol [{}] takes no action" , getName (), readerProtocol );
206205 }
207206 }
208207
@@ -214,8 +213,7 @@ public void activateProtocol(String readerProtocol) {
214213 @ Override
215214 public void deactivateProtocol (String readerProtocol ) {
216215 if (logger .isTraceEnabled ()) {
217- logger .trace (
218- "Reader [{}]: de-activating protocol [{}] takes no action" , getName (), readerProtocol );
216+ logger .trace ("[{}] de-activating protocol [{}] takes no action" , getName (), readerProtocol );
219217 }
220218 }
221219
@@ -280,18 +278,17 @@ public void openPhysicalChannel() throws ReaderIOException, CardIOException {
280278 /* init of the card physical channel: if not yet established, opening of a new physical channel */
281279 try {
282280 if (logger .isDebugEnabled ()) {
283- logger .debug (
284- "Reader [{}]: open card physical channel for protocol [{}]" , getName (), protocol );
281+ logger .debug ("[{}] opening card physical channel for protocol [{}]" , getName (), protocol );
285282 }
286283 card = this .communicationTerminal .connect (protocol );
287284 if (isModeExclusive ) {
288285 card .beginExclusive ();
289286 if (logger .isDebugEnabled ()) {
290- logger .debug ("Reader [{}]: open card physical channel in exclusive mode" , getName ());
287+ logger .debug ("[{}] card physical channel opened in EXCLUSIVE mode" , getName ());
291288 }
292289 } else {
293290 if (logger .isDebugEnabled ()) {
294- logger .debug ("Reader [{}]: open card physical channel in shared mode" , getName ());
291+ logger .debug ("[{}] card physical channel opened in SHARED mode" , getName ());
295292 }
296293 }
297294 channel = card .getBasicChannel ();
@@ -524,7 +521,7 @@ public void stopCardPresenceMonitoringDuringProcessing() {
524521 @ Override
525522 public void waitForCardRemoval () throws ReaderIOException , TaskCanceledException {
526523 if (logger .isTraceEnabled ()) {
527- logger .trace ("Reader [{}]: start waiting card removal)" , name );
524+ logger .trace ("[{}] start waiting card removal)" , name );
528525 }
529526 loopWaitCardRemoval .set (true );
530527 try {
@@ -537,14 +534,15 @@ public void waitForCardRemoval() throws ReaderIOException, TaskCanceledException
537534 try {
538535 disconnect ();
539536 } catch (Exception e ) {
540- logger .warn ("Error while disconnecting card during card removal: {}" , e .getMessage ());
537+ logger .warn (
538+ "[{}] error while disconnecting card during card removal: {}" , name , e .getMessage ());
541539 }
542540 }
543541 if (logger .isTraceEnabled ()) {
544542 if (!loopWaitCardRemoval .get ()) {
545- logger .trace ("Reader [{}]: waiting card removal stopped" , name );
543+ logger .trace ("[{}] waiting card removal stopped" , name );
546544 } else {
547- logger .trace ("Reader [{}]: card removed" , name );
545+ logger .trace ("[{}] card removed" , name );
548546 }
549547 }
550548 if (!loopWaitCardRemoval .get ()) {
@@ -606,7 +604,7 @@ public void stopWaitForCardRemoval() {
606604 @ Override
607605 public PcscReader setSharingMode (SharingMode sharingMode ) {
608606 Assert .getInstance ().notNull (sharingMode , "sharingMode" );
609- logger .info ("Reader [{}]: set sharing mode to [ {}]" , getName (), sharingMode .name ());
607+ logger .info ("[{}] set sharing mode [newValue= {}]" , getName (), sharingMode .name ());
610608 if (sharingMode == SharingMode .SHARED ) {
611609 // if a card is present, change the mode immediately
612610 if (card != null ) {
@@ -630,7 +628,7 @@ public PcscReader setSharingMode(SharingMode sharingMode) {
630628 */
631629 @ Override
632630 public PcscReader setContactless (boolean contactless ) {
633- logger .info ("Reader [{}]: set contactless type to [ {}]" , getName (), contactless );
631+ logger .info ("[{}] set contactless type [newValue= {}]" , getName (), contactless );
634632 this .isContactless = contactless ;
635633 return this ;
636634 }
@@ -644,7 +642,7 @@ public PcscReader setContactless(boolean contactless) {
644642 public PcscReader setIsoProtocol (IsoProtocol isoProtocol ) {
645643 Assert .getInstance ().notNull (isoProtocol , "isoProtocol" );
646644 logger .info (
647- "Reader [{}]: set ISO protocol to [{}] ({}) " ,
645+ "[{}] set ISO protocol [protocolName={}, newValue={}] " ,
648646 getName (),
649647 isoProtocol .name (),
650648 isoProtocol .getValue ());
@@ -660,7 +658,7 @@ public PcscReader setIsoProtocol(IsoProtocol isoProtocol) {
660658 @ Override
661659 public PcscReader setDisconnectionMode (DisconnectionMode disconnectionMode ) {
662660 Assert .getInstance ().notNull (disconnectionMode , "disconnectionMode" );
663- logger .info ("Reader [{}]: set disconnection mode to [ {}]" , getName (), disconnectionMode .name ());
661+ logger .info ("[{}] set disconnection mode [newValue= {}]" , getName (), disconnectionMode .name ());
664662 this .disconnectionMode = disconnectionMode ;
665663 return this ;
666664 }
0 commit comments