From d706ff266b45d1c17522d3c54a026fdab13fe346 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 8df411cd..c98d2135 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;