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:
Philipp Maier
2026-01-20 12:42:16 +01:00
parent 167d6aca36
commit 2b42877389
7 changed files with 13 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ from pathlib import Path
from pySim.log import PySimLogger
from packaging import version
log = PySimLogger.get("CSV2PGQSL")
log = PySimLogger.get(Path(__file__).stem)
class CardKeyDatabase:
def __init__(self, config_filename: str, table_name: str, create_table: bool = False, admin: bool = False):
@@ -35,7 +35,6 @@ class CardKeyDatabase:
raise ValueError("user for role '%s' not set up in config file." % role)
return user.get('name'), user.get('pass')
log = PySimLogger.get("PGSQL")
self.table = table_name.lower()
self.cols = None