Skip to content

Commit

Permalink
support/log: add missing log_fmt
Browse files Browse the repository at this point in the history
Add missing log_fmt define on some files that logs. Also, do not default
to the default debug level if LOGV is set above DEBUG. In that case,
just remain at DEBUG level.

Signed-off-by: Klaus Jensen <[email protected]>
  • Loading branch information
birkelund committed Nov 9, 2023
1 parent 3ba79ae commit f7c0ab4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/nvme/rq.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* COPYING and LICENSE files for more information.
*/

#define log_fmt(fmt) "nvme/rq: " fmt

#include <assert.h>
#include <byteswap.h>
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/support/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void __attribute__((constructor)) init_log_level(void)
goto set_default;

v = strtol(buf, &endptr, 0);
if (endptr == buf || v > LOG_DEBUG)
if (endptr == buf)
goto set_default;

__log_state.v = (int)v;
Expand Down
2 changes: 2 additions & 0 deletions src/support/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* COPYING and LICENSE files for more information.
*/

#define log_fmt(fmt) "support/mem: " fmt

#include <errno.h>
#ifdef __GLIBC__
#include <execinfo.h>
Expand Down
2 changes: 2 additions & 0 deletions src/support/ticks.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* From DPDK; modified by the libvfn Authors.
*/

#define log_fmt(fmt) "support/ticks: " fmt

#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
Expand Down

0 comments on commit f7c0ab4

Please sign in to comment.