You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert(0 < cAttributes); // we can't allocate zero byte arrays. This is checked when we were initially called, but I'm leaving it here again as documentation
do { /* using a do loop here gives us a nice look to the macro where the caller needs to use a semi-colon to call it, and it can be used after a single if statement without curly braces */ \
25
25
constexprsignedchar LOG__traceLevel = (traceLevel); /* we only use traceLevel once, which avoids pre and post decrement issues with macros */ \
26
26
static_assert(TraceLevelOff < LOG__traceLevel, "traceLevel can't be TraceLevelOff or lower for call to LOG(traceLevel, pLogMessage, ...)"); \
27
-
static_assert(LOG__traceLevel <= TraceLevelVerbose, "traceLevel can't be higher than TraceLevelDebug for call to LOG(traceLevel, pLogMessage, ...)"); \
27
+
static_assert(LOG__traceLevel <= TraceLevelVerbose, "traceLevel can't be higher than TraceLevelVerbose for call to LOG(traceLevel, pLogMessage, ...)"); \
do { /* using a do loop here gives us a nice look to the macro where the caller needs to use a semi-colon to call it, and it can be used after a single if statement without curly braces */ \
43
-
constexprsignedchar LOG__traceLevel = (traceLevel); /* we only use traceLevel once, which avoids pre and post decrement issues with macros */ \
44
-
static_assert(TraceLevelOff < LOG__traceLevel, "traceLevel can't be TraceLevelOff or lower for call to LOG(traceLevel, pLogMessage, ...)"); \
45
-
static_assert(LOG__traceLevel <= TraceLevelVerbose, "traceLevel can't be higher than TraceLevelDebug for call to LOG(traceLevel, pLogMessage, ...)"); \
constexprsignedchar LOG__traceLevelBefore = (traceLevelBefore); /* we only use traceLevelBefore once, which avoids pre and post decrement issues with macros */ \
44
+
static_assert(TraceLevelOff < LOG__traceLevelBefore, "traceLevelBefore can't be TraceLevelOff or lower for call to LOG_COUNTED(pLogCount, traceLevelBefore, traceLevelAfter, pLogMessage, ...)"); \
45
+
static_assert(LOG__traceLevelBefore <= TraceLevelVerbose, "traceLevelBefore can't be higher than TraceLevelVerbose for call to LOG_COUNTED(pLogCount, traceLevelBefore, traceLevelAfter, pLogMessage, ...)"); \
46
+
constexprsignedchar LOG__traceLevelAfter = (traceLevelAfter); /* we only use traceLevelAfter once, which avoids pre and post decrement issues with macros */ \
47
+
static_assert(TraceLevelOff < LOG__traceLevelAfter, "traceLevelAfter can't be TraceLevelOff or lower for call to LOG_COUNTED(pLogCount, traceLevelBefore, traceLevelAfter, pLogMessage, ...)"); \
48
+
static_assert(LOG__traceLevelAfter <= TraceLevelVerbose, "traceLevelAfter can't be higher than TraceLevelVerbose for call to LOG_COUNTED(pLogCount, traceLevelBefore, traceLevelAfter, pLogMessage, ...)"); \
49
+
static_assert(LOG__traceLevelBefore < LOG__traceLevelAfter, "We only support increasing the required trace level after N iterations and it doesn't make sense to have equal values, otherwise just use LOG(..)"); \
constexprstaticchar LOG__originalMessage[] = (pLogMessage); /* we only use pLogMessage once, which avoids pre and post decrement issues with macros */ \
53
+
unsignedint * const LOG__pLogCountDecrement = (pLogCountDecrement); /* we only use pLogCountDecrement once, which avoids pre and post decrement issues with macros */ \
constexprstaticchar LOG__originalMessage[] = (pLogMessage); /* we only use pLogMessage once, which avoids pre and post decrement issues with macros */ \
53
57
if(0 == LOG__cArguments) { /* if there are no arguments we might as well send the log directly without reserving stack space for vsnprintf and without log length limitations for stack allocation */ \
if(0 == LOG__cArguments) { /* if there are no arguments we might as well send the log directly without reserving stack space for vsnprintf and without log length limitations for stack allocation */ \
0 commit comments