aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-10-10 08:48:27 -0700
committerMartin Braun <martin.braun@ettus.com>2019-10-10 10:54:50 -0700
commit88b42db9cce3469369f99475ba802d69a821dd06 (patch)
tree54a24f16df20844d2b3f9d61312b2c4d2b49ce47 /host/lib/utils
parent17dd4c4b167bff5f150237cf24567126e4961c6a (diff)
downloaduhd-88b42db9cce3469369f99475ba802d69a821dd06.tar.gz
uhd-88b42db9cce3469369f99475ba802d69a821dd06.tar.bz2
uhd-88b42db9cce3469369f99475ba802d69a821dd06.zip
log: Honour log levels on session init
The first log message of UHD is always something like this: [INFO] [UHD] linux; GNU C++ version [...] However, it was being printed regardless of the requested log level. This will disable all initial log messages if the requested log level is greater than INFO.
Diffstat (limited to 'host/lib/utils')
-rw-r--r--host/lib/utils/log.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/host/lib/utils/log.cpp b/host/lib/utils/log.cpp
index b5c96867b..8bcf13ebc 100644
--- a/host/lib/utils/log.cpp
+++ b/host/lib/utils/log.cpp
@@ -462,6 +462,9 @@ private:
const uhd::log::severity_level level = uhd::log::info,
const std::string& component = "LOGGING")
{
+ if (level < global_level) {
+ return;
+ }
auto log_msg = uhd::log::logging_info(pt::microsec_clock::local_time(),
level,
__FILE__,