From 93ae23dabbde590a1b61895d07d2ffa40c3d3e49 Mon Sep 17 00:00:00 2001 From: Damian Hobson-Garcia Date: Thu, 16 Sep 2021 18:07:54 +0900 Subject: [PATCH] log: Add line number to debug log output Some debug logging, such as memory allocation failure, uses similar log messageing in several places. Add the file line number to the debug log to help differentiate where notable errors occured. Change-Id: I2151e21533716ea0badbb6303b713e644b544e6d Signed-off-by: Damian Hobson-Garcia --- common/log.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/log.h b/common/log.h index cd0c0e3..ed3b2db 100644 --- a/common/log.h +++ b/common/log.h @@ -19,8 +19,9 @@ #include #include -#define DEBUG_LOG(FMT, ...) \ - dlm_log_print(true, stdout, "DEBUG: %s: " FMT, __func__, ##__VA_ARGS__) +#define DEBUG_LOG(FMT, ...) \ + dlm_log_print(true, stdout, "DEBUG: %s: line %d: " FMT, __func__, \ + __LINE__, ##__VA_ARGS__) #define INFO_LOG(FMT, ...) \ dlm_log_print(false, stdout, "INFO: " FMT, ##__VA_ARGS__) #define WARN_LOG(FMT, ...) \ -- 2.16.6