From e9845000582db2f39c12a272b927e1b705a2382f Mon Sep 17 00:00:00 2001 From: Amirsaman Memaripour Date: Mon, 4 May 2020 17:45:55 -0400 Subject: SERVER-47775 Log failure to collect stacktrace at error level (cherry picked from commit 5b877cc1bc76fffc70261808c13807bb46ddc05b) --- src/mongo/util/stacktrace_posix.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mongo/util/stacktrace_posix.cpp b/src/mongo/util/stacktrace_posix.cpp index 531e21bdc24..51ce602df19 100644 --- a/src/mongo/util/stacktrace_posix.cpp +++ b/src/mongo/util/stacktrace_posix.cpp @@ -428,12 +428,10 @@ void printStackTraceImpl(const Options& options, StackTraceSink* sink = nullptr) BSONObj obj = bob.done(); if (!err.empty()) { - static constexpr char fmtErr[] = "Error collecting stack trace: {err}"; if (sink) { - *sink << fmt::format(fmtErr, "err"_a = err); - } else { - LOGV2(31430, fmtErr, "err"_attr = err); + *sink << fmt::format(FMT_STRING("Error collecting stack trace: {}"), err); } + LOGV2_ERROR(31430, "Error collecting stack trace", "error"_attr = err); return; } static constexpr char fmtBt[] = "BACKTRACE: {bt}"; -- cgit v1.2.1