- Add _LOG_TRACE compile option to enable LG_LOG_TRACE_*() macros.

This commit is contained in:
Arnaud G. GIBERT 2024-05-06 19:11:11 +02:00
parent 1862bd00e9
commit 931d48ac97
2 changed files with 29 additions and 0 deletions

View File

@ -74,6 +74,7 @@ CFLAGS=
ifeq ($(DEBUG), YES) ifeq ($(DEBUG), YES)
CFLAGS += -g -D_DEBUG CFLAGS += -g -D_DEBUG
endif endif
ifeq ($(DEBUG), Y) ifeq ($(DEBUG), Y)
CFLAGS += -g -D_DEBUG CFLAGS += -g -D_DEBUG
endif endif
@ -81,6 +82,15 @@ endif
ifeq ($(OPTIM), YES) ifeq ($(OPTIM), YES)
CFLAGS += -O3 CFLAGS += -O3
endif endif
ifeq ($(OPTIM), Y) ifeq ($(OPTIM), Y)
CFLAGS += -O3 CFLAGS += -O3
endif endif
ifeq ($(LOG_TRACE), YES)
CFLAGS += -D_LOG_TRACE
endif
ifeq ($(LOG_TRACE), Y)
CFLAGS += -D_LOG_TRACE
endif

View File

@ -103,6 +103,8 @@ typedef short LGT_Log_Level;
#ifdef _LOG_TRACE
#define LG_LOG_TRACE_0( Level, Fmt) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt)) #define LG_LOG_TRACE_0( Level, Fmt) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt))
#define LG_LOG_TRACE_1( Level, Fmt, Arg1) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1)) #define LG_LOG_TRACE_1( Level, Fmt, Arg1) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1))
#define LG_LOG_TRACE_2( Level, Fmt, Arg1, Arg2) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2)) #define LG_LOG_TRACE_2( Level, Fmt, Arg1, Arg2) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2))
@ -117,6 +119,23 @@ typedef short LGT_Log_Level;
#define LG_LOG_TRACE_11( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5), (Arg6), (Arg7), (Arg8), (Arg9), (Arg10), (Arg11)) #define LG_LOG_TRACE_11( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5), (Arg6), (Arg7), (Arg8), (Arg9), (Arg10), (Arg11))
#define LG_LOG_TRACE_12( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5), (Arg6), (Arg7), (Arg8), (Arg9), (Arg10), (Arg11), (Arg12)) #define LG_LOG_TRACE_12( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12) LG_Log( LGD_LOG_TYPE_ID_TRACE, (Level), LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2), (Arg3), (Arg4), (Arg5), (Arg6), (Arg7), (Arg8), (Arg9), (Arg10), (Arg11), (Arg12))
#else
#define LG_LOG_TRACE_0( Level, Fmt)
#define LG_LOG_TRACE_1( Level, Fmt, Arg1)
#define LG_LOG_TRACE_2( Level, Fmt, Arg1, Arg2)
#define LG_LOG_TRACE_3( Level, Fmt, Arg1, Arg2, Arg3)
#define LG_LOG_TRACE_4( Level, Fmt, Arg1, Arg2, Arg3, Arg4)
#define LG_LOG_TRACE_5( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5)
#define LG_LOG_TRACE_6( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)
#define LG_LOG_TRACE_7( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
#define LG_LOG_TRACE_8( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8)
#define LG_LOG_TRACE_9( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9)
#define LG_LOG_TRACE_10( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10)
#define LG_LOG_TRACE_11( Level, Fmt, Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11)
#endif
#define LG_LOG_INFO_0( Fmt) LG_Log( LGD_LOG_TYPE_ID_INFO, LGD_LOG_LEVEL_DEFAULT, LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt)) #define LG_LOG_INFO_0( Fmt) LG_Log( LGD_LOG_TYPE_ID_INFO, LGD_LOG_LEVEL_DEFAULT, LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt))
#define LG_LOG_INFO_1( Fmt, Arg1) LG_Log( LGD_LOG_TYPE_ID_INFO, LGD_LOG_LEVEL_DEFAULT, LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1)) #define LG_LOG_INFO_1( Fmt, Arg1) LG_Log( LGD_LOG_TYPE_ID_INFO, LGD_LOG_LEVEL_DEFAULT, LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1))
#define LG_LOG_INFO_2( Fmt, Arg1, Arg2) LG_Log( LGD_LOG_TYPE_ID_INFO, LGD_LOG_LEVEL_DEFAULT, LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2)) #define LG_LOG_INFO_2( Fmt, Arg1, Arg2) LG_Log( LGD_LOG_TYPE_ID_INFO, LGD_LOG_LEVEL_DEFAULT, LGD_MODULE_NAME, __FILE__, __LINE__, __func__, true, (Fmt), (Arg1), (Arg2))