Hoernchen has submitted this change. (
https://gerrit.osmocom.org/c/pysim/+/43554?usp=email )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted
one.
)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(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
dexter: Looks good to me, approved
diff --git a/pySim-shell.py b/pySim-shell.py
index be1d783..2d9d356 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 5a630c8..f99fd89 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):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43554?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I828ea36b06da36b6bb0aa073d235d4f49cbb3161
Gerrit-Change-Number: 43554
Gerrit-PatchSet: 3
Gerrit-Owner: Hoernchen <[email protected]>
Gerrit-Reviewer: Hoernchen <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>