1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

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

This commit is contained in:
David Steele 2018-07-20 07:15:28 -04:00
parent 0ac176b722
commit fa53e2eddb
3 changed files with 10 additions and 3 deletions

View File

@ -60,6 +60,10 @@
<p>Require <postgres/> catalog version when instantiating a <code>Manifest</code> object (and not loading it from disk).</p>
</release-item>
<release-item>
<p>Show exact log level required for stack trace param output instead of just <quote>debug</quote>.</p>
</release-item>
</release-development-list>
</release-core-list>

View File

@ -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 *

View File

@ -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()
{