aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/mpmlog.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-15 15:05:20 -0800
committerMartin Braun <martin.braun@ettus.com>2018-02-08 22:18:14 +0100
commite6dc09470d506cfe4e74fc52f8a8ef21c16b9f2f (patch)
tree297a48418f48518bc8eed36bcb7bdf859e54941c /mpm/python/usrp_mpm/mpmlog.py
parentebacd27d4948193f591ff35266ad453d10cb9b28 (diff)
downloaduhd-e6dc09470d506cfe4e74fc52f8a8ef21c16b9f2f.tar.gz
uhd-e6dc09470d506cfe4e74fc52f8a8ef21c16b9f2f.tar.bz2
uhd-e6dc09470d506cfe4e74fc52f8a8ef21c16b9f2f.zip
mpm: Add prefs modules
- prefs is a module for centralized preferences management - Uses Python's ConfigParser module
Diffstat (limited to 'mpm/python/usrp_mpm/mpmlog.py')
-rw-r--r--mpm/python/usrp_mpm/mpmlog.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/mpmlog.py b/mpm/python/usrp_mpm/mpmlog.py
index 0c37e92bf..113d4bd06 100644
--- a/mpm/python/usrp_mpm/mpmlog.py
+++ b/mpm/python/usrp_mpm/mpmlog.py
@@ -148,7 +148,7 @@ def get_main_logger(
DEFAULT_LOG_LEVEL - log_default_delta * 10,
CRITICAL
))
- default_log_level = max(1, default_log_level - (default_log_level % 10))
+ default_log_level = max(TRACE, default_log_level - (default_log_level % 10))
LOGGER.setLevel(default_log_level)
# Connect to C++ logging:
if LOGGER.cpp_log_buf is not None:
@@ -160,6 +160,10 @@ def get_main_logger(
lib_logger.log(log_level, "[%s] %s",
component, message.strip())
LOGGER.cpp_log_buf.set_notify_callback(log_from_cpp)
+ # Flush errors stuck in the prefs module:
+ log = LOGGER.getChild('prefs')
+ for err_key, err_msg in mpm_prefs['__ERRORS__'].items():
+ log.error('%s: %s', err_key, err_msg)
return LOGGER
def get_logger(child_name):