From 7596045245a5becc7bb528d0f8515cfb7eb6e33c Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 7 May 2026 15:27:08 +0200 Subject: [PATCH] pySim/filesystem: use pySimLogger instead of print let's replace the stray print statements with proper logger calls. Related: SYS#6959 --- pySim/filesystem.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 95fae367..04806cb1 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -44,6 +44,7 @@ from pySim.utils import sw_match, decomposeATR from pySim.jsonpath import js_path_modify from pySim.commands import SimCardCommands from pySim.exceptions import SwMatchError +from pySim.log import PySimLogger # int: a single service is associated with this file # list: any of the listed services requires this file @@ -52,6 +53,8 @@ CardFileService = Union[int, List[int], Tuple[int, ...]] Size = Tuple[int, Optional[int]] +log = PySimLogger.get(__name__) + class CardFile: """Base class for all objects in the smart card filesystem. Serve as a common ancestor to all other file types; rarely used directly. @@ -1609,14 +1612,14 @@ class CardModel(abc.ABC): card_atr = scc.get_atr() for atr in cls._atrs: if atr == card_atr: - print("Detected CardModel:", cls.__name__) + log.info("Detected CardModel: %s", cls.__name__) return True # if nothing found try to just compare the Historical Bytes of the ATR card_atr_hb = decomposeATR(card_atr)['hb'] for atr in cls._atrs: atr_hb = decomposeATR(atr)['hb'] if atr_hb == card_atr_hb: - print("Detected CardModel:", cls.__name__) + log.info("Detected CardModel: %s", cls.__name__) return True return False