Add log_exc_printf() with stack trace

This commit is contained in:
Michael Davidsaver
2020-04-03 10:21:46 -07:00
parent 5f244c1b88
commit facb18ae00
11 changed files with 38 additions and 19 deletions
+9
View File
@@ -15,7 +15,9 @@
#include <pvxs/log.h>
#include <envDefs.h>
#include <dbDefs.h>
#include <osiSock.h>
#include <epicsStackTrace.h>
#include <epicsString.h>
#include <epicsAssert.h>
#include <epicsStdio.h>
@@ -65,6 +67,13 @@ const char* log_prefix(const char* name, Level lvl)
return prefix;
}
void log_stacktrace()
{
// stack traces can be long. flush to reduce truncation
errlogFlush();
epicsStackTrace();
}
} // namespace detail
namespace {