mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
pySimLogger: user __name__ of the module when creating a new logger
At the moment we use random identifiers as names when we create a new logger for pySimLogger. Let's switch to consistently use the module name here. For the top level modules let's use the program name so that it will show up in the log instead of __init__. Change-Id: I49a9beb98845f66247edd42ed548980c97a7151a
This commit is contained in:
@@ -38,7 +38,7 @@ import csv
|
||||
import logging
|
||||
import yaml
|
||||
|
||||
log = PySimLogger.get("CARDKEY")
|
||||
log = PySimLogger.get(__name__)
|
||||
|
||||
card_key_providers = [] # type: List['CardKeyProvider']
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class PySimLogger:
|
||||
"""
|
||||
|
||||
LOG_FMTSTR = "%(levelname)s: %(message)s"
|
||||
LOG_FMTSTR_VERBOSE = "%(module)s.%(lineno)d -- %(name)s - " + LOG_FMTSTR
|
||||
LOG_FMTSTR_VERBOSE = "%(module)s.%(lineno)d -- " + LOG_FMTSTR
|
||||
__formatter = logging.Formatter(LOG_FMTSTR)
|
||||
__formatter_verbose = logging.Formatter(LOG_FMTSTR_VERBOSE)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ from pySim.exceptions import *
|
||||
from pySim.filesystem import *
|
||||
from pySim.log import PySimLogger
|
||||
|
||||
log = PySimLogger.get("RUNTIME")
|
||||
log = PySimLogger.get(__name__)
|
||||
|
||||
def lchan_nr_from_cla(cla: int) -> int:
|
||||
"""Resolve the logical channel number from the CLA byte."""
|
||||
|
||||
Reference in New Issue
Block a user