diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/VirtualSmartcard.py b/virtualsmartcard/src/vpicc/virtualsmartcard/VirtualSmartcard.py index 04ebaa4..9b4434d 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/VirtualSmartcard.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/VirtualSmartcard.py @@ -476,8 +476,8 @@ class VirtualICC(object): self.sock.settimeout(None) self.server_sock = None except socket.error as e: - logging.error("Failed to open socket: %s", str(e)) - logging.error("Is pcscd running at %s? Is vpcd loaded? Is a \ + logging.critical("Failed to open socket: %s", str(e)) + logging.critical("Is pcscd running at %s? Is vpcd loaded? Is a \ firewall blocking port %u?", host, port) sys.exit() else: @@ -498,8 +498,8 @@ class VirtualICC(object): (self.sock, self.server_sock, host) = self.openPort(port) self.sock.settimeout(None) except socket.error as e: - logging.error("Failed to open socket: %s", str(e)) - logging.error("Is pcscd running? Is vpcd loaded and in \ + logging.critical("Failed to open socket: %s", str(e)) + logging.critical("Is pcscd running? Is vpcd loaded and in \ reversed connection mode? Is a firewall \ blocking port %u?", port) sys.exit() @@ -581,6 +581,7 @@ class VirtualICC(object): (self.sock, address) = self.server_sock.accept() continue else: + logging.critical(str(e)) sys.exit() if not size: diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/Relay.py b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/Relay.py index 2373f8d..d4a27c5 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/Relay.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/Relay.py @@ -41,7 +41,7 @@ class RelayOS(SmartcardOS): # See which readers are available readers = smartcard.System.listReaders() if len(readers) <= readernum: - logging.error("Invalid number of reader '%u' (only %u available)", + logging.critical("Invalid number of reader '%u' (only %u available)", readernum, len(readers)) sys.exit() @@ -53,7 +53,7 @@ class RelayOS(SmartcardOS): try: self.session = smartcard.Session(self.reader) except smartcard.Exceptions.CardConnectionException as e: - logging.error("Error connecting to card: %s", e.message) + logging.critical("Error connecting to card: %s", e.message) sys.exit() logging.info("Connected to card in '%s'", self.reader) @@ -83,7 +83,7 @@ class RelayOS(SmartcardOS): self.session = smartcard.Session(self.reader) atr = self.session.getATR() except smartcard.Exceptions.CardConnectionException as e: - logging.error("Error getting ATR: %s", e.message) + logging.critical("Error getting ATR: %s", e.message) sys.exit() return "".join([chr(b) for b in atr]) @@ -99,7 +99,7 @@ class RelayOS(SmartcardOS): try: self.session = smartcard.Session(self.reader) except smartcard.Exceptions.CardConnectionException as e: - logging.error("Error connecting to card: %s", e.message) + logging.critical("Error connecting to card: %s", e.message) sys.exit() def powerDown(self): @@ -108,7 +108,7 @@ class RelayOS(SmartcardOS): try: self.session.close() except smartcard.Exceptions.CardConnectionException as e: - logging.error("Error disconnecting from card: %s", str(e)) + logging.critical("Error disconnecting from card: %s", str(e)) sys.exit() def reset(self): @@ -127,7 +127,7 @@ class RelayOS(SmartcardOS): try: rapdu, sw1, sw2 = self.session.sendCommandAPDU(apdu) except smartcard.Exceptions.CardConnectionException as e: - logging.error("Error transmitting APDU: %s", str(e)) + logging.critical("Error transmitting APDU: %s", str(e)) sys.exit() # XXX this is a workaround, see on sourceforge bug #3083586