From e9a7db19ab1c2ad99c47092ffe186e46eccc0895 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 15 Nov 2017 11:14:04 -0800 Subject: mpm: Fix minor logging issues with LMK04828 code Log prefixes weren't properly being set. --- mpm/python/usrp_mpm/chips/lmk04828.py | 5 ++--- mpm/python/usrp_mpm/dboard_manager/lmk_mg.py | 5 ++--- mpm/python/usrp_mpm/dboard_manager/magnesium.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mpm/python/usrp_mpm/chips/lmk04828.py b/mpm/python/usrp_mpm/chips/lmk04828.py index 4d2839bf9..121d855ca 100644 --- a/mpm/python/usrp_mpm/chips/lmk04828.py +++ b/mpm/python/usrp_mpm/chips/lmk04828.py @@ -27,9 +27,8 @@ class LMK04828(object): """ LMK_CHIP_ID = 6 - def __init__(self, regs_iface, postfix=None): - postfix = postfix or "" - self.log = get_logger("LMK04828-{}".format(postfix)) + def __init__(self, regs_iface, parent_log=None): + self.log = parent_log.getChild("LMK04828") or get_logger("LMK04828") self.regs_iface = regs_iface assert hasattr(self.regs_iface, 'peek8') assert hasattr(self.regs_iface, 'poke8') diff --git a/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py b/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py index 4890645aa..e6a1821af 100644 --- a/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py +++ b/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py @@ -25,11 +25,10 @@ from ..mpmlog import get_logger from ..chips import LMK04828 class LMK04828Mg(LMK04828): - def __init__(self, regs_iface, spi_lock, ref_clock_freq, slot=None): - LMK04828.__init__(self, regs_iface, slot) + def __init__(self, regs_iface, spi_lock, ref_clock_freq, log=None): + LMK04828.__init__(self, regs_iface, log) self.log.trace("Using reference clock frequency {} MHz".format(ref_clock_freq/1e6)) self.spi_lock = spi_lock - self.log = get_logger("LMK04828") assert hasattr(self.spi_lock, 'lock') assert hasattr(self.spi_lock, 'unlock') self.ref_clock_freq = ref_clock_freq diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py index 02803b61c..032502012 100644 --- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py +++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py @@ -468,7 +468,7 @@ class Magnesium(DboardManagerBase): )) pdac_spi.poke16(0x0, init_phase_dac_word) self.spi_lock = self._device.get_spi_lock() - return LMK04828Mg(lmk_spi, self.spi_lock, ref_clk_freq, slot_idx) + return LMK04828Mg(lmk_spi, self.spi_lock, ref_clk_freq, self.log) def _sync_db_clock(synchronizer): " Synchronizes the DB clock to the common reference " synchronizer.run_sync(measurement_only=False) -- cgit v1.2.3