From 06b34df59ce471bec1327d9556c302cd4d03060e Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 15 Feb 2024 09:21:20 -0500 Subject: [PATCH] log: Respect DEFAULT_LOGLEVEL on uninitialized logging When logging has not been initialized and no root available, logging via nvme_msg() would just print everything. Better to check against DEFAULT_LOGLEVEL in such cases. Signed-off-by: Tomas Bzatek --- src/nvme/log.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvme/log.c b/src/nvme/log.c index 28976bdf..c093760b 100644 --- a/src/nvme/log.c +++ b/src/nvme/log.c @@ -58,6 +58,8 @@ __nvme_msg(nvme_root_t r, int lvl, if (r && lvl > r->log_level) return; + if (!r && lvl > DEFAULT_LOGLEVEL) + return; if (r && r->log_timestamp) { struct timespec now;