Skip to content

Commit

Permalink
log: Respect DEFAULT_LOGLEVEL on uninitialized logging
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tbzatek committed Feb 15, 2024
1 parent 0ca8e70 commit 06b34df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nvme/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 06b34df

Please sign in to comment.