Attention is currently required from: dexter.
fixeria has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/41890?usp=email )
Change subject: pySimLogger: user __name__ of the module when creating a new logger ......................................................................
Patch Set 1:
(4 comments)
File contrib/csv-to-pgsql.py:
https://gerrit.osmocom.org/c/pysim/+/41890/comment/f4052dc8_95f1a433?usp=ema... : PS1, Line 15: __name__ See my comment in `pySim-shell.py`.
https://gerrit.osmocom.org/c/pysim/+/41890/comment/f3d50379_6033ad63?usp=ema... : PS1, Line 38: log = PySimLogger.get(__name__) This becomes an equivalent of the logger above, and thus can be removed?
File pySim-shell.py:
https://gerrit.osmocom.org/c/pysim/+/41890/comment/404036ff_6b74e1e8?usp=ema... : PS1, Line 77: __name__ Since this is the top level of the hierarchy, it's actually desirable to set the module name manually (e.g. `"pySim-shell"`) here. Otherwise it will show up as `__main__` in logging.
Same applies to `pySim-trace.py` and others, but AFAICS they're not using logging yet.
File pySim/card_key_provider.py:
https://gerrit.osmocom.org/c/pysim/+/41890/comment/02487ed1_7f3e06e2?usp=ema... : PS1, Line 41: PySimLogger.get You no longer need to call `PySimLogger.get` here nor in other modules of the `pySim` namespace. Instead, you can do the following:
``` import logging # already imported above
log = logging.getLogger(__name__) ```
Being part of the module hierarchy, this module inherits logging configuration of the parent loggers. The only place where you'll still need to use the `PySimLogger` API is top-level scripts (entry-points) like `pySim-shell.py`.
This can be done in a separate patch.