Attention is currently required from: dexter.
3 comments:
Patchset:
It would be nice to have a command line option `-v/--verbose` to increase logging verbosity of pySim-shell.py (and other apps). Here's an example from my pet project:
https://gitea.osmocom.org/fixeria/sedbgmux/src/commit/b82a26f5b80a09687b82d9b277b0b8ac1c104a2b/sedbgmux-shell.py#L311
https://gitea.osmocom.org/fixeria/sedbgmux/src/commit/b82a26f5b80a09687b82d9b277b0b8ac1c104a2b/sedbgmux-shell.py#L54
File pySim/log.py:
Patch Set #6, Line 62: staticmethod
You can use the `@classmethod` instead, which allows to reference "this class".
```
@classmethod
def _log_callback(cls, message, record):
if not cls.print_callback:
# ...
```
File pySim/runtime.py:
Patch Set #6, Line 48: self.log = PySimLogger.get("RuntimeState")
A more usual approach is to have a module-local logger:
```
log = PySimLogger.get(__name__)
```
This way all functions and classes can use it. For example:
https://gitea.osmocom.org/fixeria/sedbgmux/src/commit/b82a26f5b80a09687b82d9b277b0b8ac1c104a2b/sedbgmux/client.py#L33
And moreover, you get precise control over logging level for each module:
https://gitea.osmocom.org/fixeria/sedbgmux/src/commit/b82a26f5b80a09687b82d9b277b0b8ac1c104a2b/sedbgmux-shell.py#L121
Does not mean you cannot have per-instance loggers though.
To view, visit change 41229. To unsubscribe, or for help writing mail filters, visit settings.