Replace root logger calls with module-specific loggers

This commit is contained in:
Ian Renton
2026-08-15 08:35:06 +01:00
parent 74bcd9cded
commit dd89ff4af7
64 changed files with 328 additions and 216 deletions
+3 -1
View File
@@ -10,6 +10,8 @@ from core.call_lookup_helper import get_call_info
from core.sig_lookup_helper import populate_missing_sig_ref_info
from core.utils import get_flag_for_dxcc
logger = logging.getLogger(__name__)
@dataclass
class Alert:
@@ -128,7 +130,7 @@ class Alert:
self.dx_names = list(map(lambda c: get_call_info(c, credentials).name, self.dx_calls))
except Exception:
logging.exception("Exception while inferring missing data from spot")
logger.exception("Exception while inferring missing data from spot")
def to_json(self):
"""JSON serialise"""
+6 -4
View File
@@ -27,6 +27,8 @@ from core.utils import (
)
from data.sig_ref import SIGRef
logger = logging.getLogger(__name__)
@dataclass
class Spot:
@@ -340,7 +342,7 @@ class Spot:
self.propagation_mode = PROPAGATION_MODES[mode_tag]
else:
self.propagation_mode = mode_tag
logging.info(f"Seen a new propagation mode tag not yet in the system: {mode_tag}")
logger.info(f"Seen a new propagation mode tag not yet in the system: {mode_tag}")
# Parse "de_grid -> dx_grid" structures from the comment
if self.comment:
@@ -363,12 +365,12 @@ class Spot:
self.dx_latitude = ll[0]
self.dx_longitude = ll[1]
except:
logging.debug("Invalid grid received for spot")
logger.debug("Invalid grid received for spot")
if self.dx_latitude and self.dx_longitude and not self.dx_grid:
try:
self.dx_grid = latlong_to_locator(self.dx_latitude, self.dx_longitude, 8)
except:
logging.debug("Invalid lat/lon received for spot")
logger.debug("Invalid lat/lon received for spot")
# QRT comment detection
if self.comment and not self.qrt:
@@ -444,7 +446,7 @@ class Spot:
self.de_grid = de_call_info.grid
except Exception:
logging.exception("Exception while inferring missing data from spot")
logger.exception("Exception while inferring missing data from spot")
def to_json(self):
"""JSON serialise"""