yiguolei commented on code in PR #23072: URL: https://github.com/apache/doris/pull/23072#discussion_r1296580470
########## be/src/common/status.h: ########## @@ -346,10 +343,24 @@ class Status { template <int code, bool stacktrace = true, typename... Args> Status static Error(std::string_view msg, Args&&... args) { - return Error<stacktrace>(code, msg, std::forward<Args>(args)...); + Status status; + status._code = code; + status._err_msg = std::make_unique<ErrMsg>(); + if constexpr (sizeof...(args) == 0) { + status._err_msg->_msg = msg; + } else { + status._err_msg->_msg = fmt::format(msg, std::forward<Args>(args)...); + } +#ifdef ENABLE_STACKTRACE + if constexpr (stacktrace && capture_stacktrace(code)) { + status._err_msg->_stack = get_stack_trace(); + LOG(WARNING) << "meet error status: " << status; // may print too many stacks. + } +#endif + return status; } - template <bool stacktrace = true, typename... Args> + template <bool stacktrace = false, typename... Args> Review Comment: why change the value to false? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org