mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 06:17:41 +00:00
Replace root logger calls with module-specific loggers
This commit is contained in:
+3
-1
@@ -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
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user