Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/43554?usp=email )
Change subject: transport: trace APDUs when they are sent ......................................................................
transport: trace APDUs when they are sent
Right now APDUs that never return/fail are omitted from the trace output. Move the print, so it actually tells me what failed..
Change-Id: I828ea36b06da36b6bb0aa073d235d4f49cbb3161 --- M pySim-shell.py M pySim/transport/__init__.py 2 files changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/54/43554/1
diff --git a/pySim-shell.py b/pySim-shell.py index 8e490f6..31de001 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -210,8 +210,10 @@ def __init__(self, cmd2_app): self.cmd2 = cmd2_app
- def trace_response(self, cmd, sw, resp): + def trace_command(self, cmd): self.cmd2.poutput("-> %s %s" % (cmd[:10], cmd[10:])) + + def trace_response(self, cmd, sw, resp): self.cmd2.poutput("<- %s: %s" % (sw, resp))
def update_prompt(self): diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index 13e0c42..0da27ac 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -45,8 +45,10 @@
class StdoutApduTracer(ApduTracer): """Minimalistic APDU tracer, printing commands to stdout.""" - def trace_response(self, cmd, sw, resp): + def trace_command(self, cmd): log.info("-> %s %s", cmd[:10], cmd[10:]) + + def trace_response(self, cmd, sw, resp): log.info("<- %s: %s", sw, resp)
def trace_reset(self):