mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-05-08 02:15:07 +03:00
pySimLogger: fix default log format string
In format string we prepend when we log in verbose mode. We use %(module)s as format string quaifier. This qualifier is replaced with the name of the module from where the logger was called. This is mostly equal to the logger name (__name__) we pass when we create the logger. However, this is not the behavior we actually want. We want to log the logger name that we passed when the logger was created. For this, we must use %(name)s as qualifier. Related: SYS#6959
This commit is contained in:
@@ -44,7 +44,7 @@ class PySimLogger:
|
||||
"""
|
||||
|
||||
LOG_FMTSTR = "%(levelname)s: %(message)s"
|
||||
LOG_FMTSTR_VERBOSE = "%(module)s.%(lineno)d -- " + LOG_FMTSTR
|
||||
LOG_FMTSTR_VERBOSE = "%(name)s.%(lineno)d -- " + LOG_FMTSTR
|
||||
__formatter = logging.Formatter(LOG_FMTSTR)
|
||||
__formatter_verbose = logging.Formatter(LOG_FMTSTR_VERBOSE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user