Skip to content
Success

Changes

Summary

  1. pySim-shell: add a logger class to centralize logging (details)
Commit b32dd704816eace6dc6b7b0b9a177069d5900748 by pmaier@sysmocom.de
pySim-shell: add a logger class to centralize logging

In many sub modules we still use print() to occassionally print status
messages or warnings. This technically does not hurt, but it is an unclean
solution which we should replace with something more mature.

Let's use python's built in logging framework to create a static logger
class that fits our needs. To maintain compatibility let's also make sure
that the logger class will behave like a normal print() statement when no
configuration parameters are supplied by the API user.

To illustrate how the approach can be used in sub-modules, this patch
replaces the print statements in runtime.py. The other print statements
will the be fixed in follow-up patches.

Related: OS#6864
Change-Id: I187f117e7e1ccdb2a85dfdfb18e84bd7561704eb
The file was modifiedtests/pySim-trace_test/pySim-trace_test_gsmtap.pcapng.ok
The file was addedpySim/log.py
The file was modifiedpySim/runtime.py
The file was modifiedpySim-shell.py