From fa53e2eddb95822553b6a860ef3e6d09fdb31f4a Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 20 Jul 2018 07:15:28 -0400 Subject: [PATCH] Show exact log level required for stack trace param output instead of just "debug". --- doc/xml/release.xml | 4 ++++ src/common/stackTrace.c | 4 +++- test/src/module/common/stackTraceTest.c | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/xml/release.xml b/doc/xml/release.xml index b85c948ce..08dafb0c6 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -60,6 +60,10 @@

Require catalog version when instantiating a Manifest object (and not loading it from disk).

+ + +

Show exact log level required for stack trace param output instead of just debug.

+
diff --git a/src/common/stackTrace.c b/src/common/stackTrace.c index 40081d579..7527eb88c 100644 --- a/src/common/stackTrace.c +++ b/src/common/stackTrace.c @@ -177,7 +177,9 @@ stackTraceParamIdx(int stackIdx) return data->param; } - return "debug log level required for parameters"; + // If no parameters return the log level required to get them + #define LOG_LEVEL_REQUIRED " log level required for parameters" + return data->functionLogLevel == logLevelTrace ? "trace" LOG_LEVEL_REQUIRED : "debug" LOG_LEVEL_REQUIRED; } const char * diff --git a/test/src/module/common/stackTraceTest.c b/test/src/module/common/stackTraceTest.c index eef4ac175..d55595beb 100644 --- a/test/src/module/common/stackTraceTest.c +++ b/test/src/module/common/stackTraceTest.c @@ -103,9 +103,10 @@ testRun() " check stack trace"); #endif - assert(stackTracePush("file1.c", "function2", logLevelDebug) == logLevelDebug); + assert(stackTracePush("file1.c", "function2", logLevelTrace) == logLevelTrace); stackTrace[stackSize - 2].fileLine = 7777; - assert(strcmp(stackTraceParam(), "debug log level required for parameters") == 0); + assert(strcmp(stackTraceParam(), "trace log level required for parameters") == 0); + stackTrace[stackSize - 1].functionLogLevel = logLevelDebug; TRY_BEGIN() {