return _mTextLocStrFmt;
}
+ void appendCauseStr(const char * const fileName, const int lineNo, const char * const initMsg,
+ const char * const msg) const noexcept
+ {
+ if (_mSelfMsgIter) {
+ bt_current_thread_error_append_cause_from_message_iterator(
+ _mSelfMsgIter->libObjPtr(), fileName, lineNo, "%s%s", initMsg, msg);
+ } else if (_mSelfComp) {
+ bt_current_thread_error_append_cause_from_component(_mSelfComp->libObjPtr(), fileName,
+ lineNo, "%s%s", initMsg, msg);
+ } else if (_mSelfCompCls) {
+ bt_current_thread_error_append_cause_from_component_class(
+ _mSelfCompCls->libObjPtr(), fileName, lineNo, "%s%s", initMsg, msg);
+ } else {
+ BT_ASSERT(_mModuleName);
+ bt_current_thread_error_append_cause_from_unknown(_mModuleName->data(), fileName,
+ lineNo, "%s%s", initMsg, msg);
+ }
+ }
+
private:
struct _StdLogWriter final
{
/* Append an error cause if needed */
if (AppendCauseV) {
- if (_mSelfMsgIter) {
- bt_current_thread_error_append_cause_from_message_iterator(
- _mSelfMsgIter->libObjPtr(), fileName, lineNo, "%s%s", initMsg, _mBuf.data());
- } else if (_mSelfComp) {
- bt_current_thread_error_append_cause_from_component(
- _mSelfComp->libObjPtr(), fileName, lineNo, "%s%s", initMsg, _mBuf.data());
- } else if (_mSelfCompCls) {
- bt_current_thread_error_append_cause_from_component_class(
- _mSelfCompCls->libObjPtr(), fileName, lineNo, "%s%s", initMsg, _mBuf.data());
- } else {
- BT_ASSERT(_mModuleName);
- bt_current_thread_error_append_cause_from_unknown(
- _mModuleName->data(), fileName, lineNo, "%s%s", initMsg, _mBuf.data());
- }
+ this->appendCauseStr(fileName, lineNo, initMsg, _mBuf.data());
}
}