From 88b42db9cce3469369f99475ba802d69a821dd06 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 10 Oct 2019 08:48:27 -0700 Subject: 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. --- host/lib/utils/log.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'host/lib') 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__, -- cgit v1.2.3