doc/api/libbabeltrace2/DoxygenLayout.xml: use `topics` tab
[babeltrace.git] / src / cpp-common / bt2c / logging.hpp
index 274c2fae51082b0ed0e9d406448b9d1141397a28..2aa22040bcf107d3516969f5121bf6bf27ab8f87 100644 (file)
@@ -22,6 +22,7 @@
 #include "cpp-common/bt2/self-component-port.hpp"
 #include "cpp-common/bt2/self-message-iterator.hpp"
 #include "cpp-common/bt2s/optional.hpp"
+#include "cpp-common/bt2s/span.hpp"
 #include "cpp-common/vendor/fmt/core.h"
 #include "cpp-common/vendor/wise-enum/wise_enum.h"
 #include "logging/log-api.h"
@@ -45,17 +46,20 @@ namespace bt2c {
 class Logger final
 {
 public:
+    using MemData = bt2s::span<const std::uint8_t>;
+
     /* clang-format off */
 
     /* Available log levels */
     WISE_ENUM_CLASS_MEMBER(Level,
-        (Trace, BT_LOG_TRACE),
-        (Debug, BT_LOG_DEBUG),
-        (Info, BT_LOG_INFO),
-        (Warning, BT_LOG_WARNING),
-        (Error, BT_LOG_ERROR),
-        (Fatal, BT_LOG_FATAL),
-        (None, BT_LOG_NONE));
+        (Trace,     BT_LOG_TRACE),
+        (Debug,     BT_LOG_DEBUG),
+        (Info,      BT_LOG_INFO),
+        (Warning,   BT_LOG_WARNING),
+        (Error,     BT_LOG_ERROR),
+        (Fatal,     BT_LOG_FATAL),
+        (None,      BT_LOG_NONE)
+    )
 
     /* clang-format on */
 
@@ -151,16 +155,6 @@ public:
         return _mLevel;
     }
 
-    /*
-     * Current logging level converted to a `bt_log_level` value.
-     *
-     * For legacy code.
-     */
-    bt_log_level cLevel() const noexcept
-    {
-        return static_cast<bt_log_level>(_mLevel);
-    }
-
     /*
      * Whether or not this logger would log at the level `level`.
      */
@@ -261,9 +255,8 @@ private:
     struct _StdLogWriter final
     {
         static void write(const char * const fileName, const char * const funcName,
-                          const unsigned lineNo, const Level level, const char * const tag,
-                          const void *, unsigned int, const char * const initMsg,
-                          const char * const msg) noexcept
+                          const unsigned lineNo, const Level level, const char * const tag, MemData,
+                          const char * const initMsg, const char * const msg) noexcept
         {
             BT_ASSERT_DBG(initMsg && std::strcmp(initMsg, "") == 0);
             bt_log_write(fileName, funcName, lineNo, static_cast<bt_log_level>(level), tag, msg);
@@ -282,24 +275,10 @@ public:
      */
     template <Level LevelV, bool AppendCauseV, typename... ArgTs>
     void log(const char * const fileName, const char * const funcName, const unsigned int lineNo,
-             const char * const fmt, ArgTs&&...args) const
+             fmt::format_string<ArgTs...> fmt, ArgTs&&...args) const
     {
-        this->_log<_StdLogWriter, LevelV, AppendCauseV>(fileName, funcName, lineNo, nullptr, 0, "",
-                                                        fmt, std::forward<ArgTs>(args)...);
-    }
-
-    /*
-     * Logs `msg` using the level `LevelV`.
-     *
-     * If `AppendCauseV` is true, this method also appends a cause to
-     * the error of the current thread using the same message.
-     */
-    template <Level LevelV, bool AppendCauseV>
-    void logStr(const char * const fileName, const char * const funcName, const unsigned int lineNo,
-                const char * const msg) const
-    {
-        this->_logStr<_StdLogWriter, LevelV, AppendCauseV>(fileName, funcName, lineNo, nullptr, 0,
-                                                           "", msg);
+        this->_log<_StdLogWriter, LevelV, AppendCauseV>(
+            fileName, funcName, lineNo, {}, "", std::move(fmt), std::forward<ArgTs>(args)...);
     }
 
     /*
@@ -308,58 +287,33 @@ public:
      */
     template <bool AppendCauseV, typename ExcT, typename... ArgTs>
     [[noreturn]] void logErrorAndThrow(const char * const fileName, const char * const funcName,
-                                       const unsigned int lineNo, const char * const fmt,
+                                       const unsigned int lineNo, fmt::format_string<ArgTs...> fmt,
                                        ArgTs&&...args) const
     {
-        this->log<Level::Error, AppendCauseV>(fileName, funcName, lineNo, fmt,
+        this->log<Level::Error, AppendCauseV>(fileName, funcName, lineNo, std::move(fmt),
                                               std::forward<ArgTs>(args)...);
         throw ExcT {};
     }
 
-    /*
-     * Like logStr() with the `Level::Error` level, but also throws a
-     * default-constructed instance of `ExcT`.
-     */
-    template <bool AppendCauseV, typename ExcT>
-    [[noreturn]] void logErrorStrAndThrow(const char * const fileName, const char * const funcName,
-                                          const unsigned int lineNo, const char * const msg) const
-    {
-        this->logStr<Level::Error, AppendCauseV>(fileName, funcName, lineNo, msg);
-        throw ExcT {};
-    }
-
     /*
      * Like log() with the `Level::Error` level, but also rethrows.
      */
     template <bool AppendCauseV, typename... ArgTs>
     [[noreturn]] void logErrorAndRethrow(const char * const fileName, const char * const funcName,
-                                         const unsigned int lineNo, const char * const fmt,
-                                         ArgTs&&...args) const
+                                         const unsigned int lineNo,
+                                         fmt::format_string<ArgTs...> fmt, ArgTs&&...args) const
     {
-        this->log<Level::Error, AppendCauseV>(fileName, funcName, lineNo, fmt,
+        this->log<Level::Error, AppendCauseV>(fileName, funcName, lineNo, std::move(fmt),
                                               std::forward<ArgTs>(args)...);
         throw;
     }
 
-    /*
-     * Like logStr() with the `Level::Error` level, but also rethrows.
-     */
-    template <bool AppendCauseV>
-    [[noreturn]] void logErrorStrAndRethrow(const char * const fileName,
-                                            const char * const funcName, const unsigned int lineNo,
-                                            const char * const msg) const
-    {
-        this->logStr<Level::Error, AppendCauseV>(fileName, funcName, lineNo, msg);
-        throw;
-    }
-
 private:
     struct _InitMsgLogWriter final
     {
         static void write(const char * const fileName, const char * const funcName,
-                          const unsigned lineNo, const Level level, const char * const tag,
-                          const void *, unsigned int, const char * const initMsg,
-                          const char * const msg) noexcept
+                          const unsigned lineNo, const Level level, const char * const tag, MemData,
+                          const char * const initMsg, const char * const msg) noexcept
         {
             bt_log_write_printf(funcName, fileName, lineNo, static_cast<bt_log_level>(level), tag,
                                 "%s%s", initMsg, msg);
@@ -379,30 +333,12 @@ public:
      */
     template <Level LevelV, bool AppendCauseV, typename... ArgTs>
     void logErrno(const char * const fileName, const char * const funcName,
-                  const unsigned int lineNo, const char * const initMsg, const char * const fmt,
-                  ArgTs&&...args) const
+                  const unsigned int lineNo, const char * const initMsg,
+                  fmt::format_string<ArgTs...> fmt, ArgTs&&...args) const
     {
-        this->_log<_InitMsgLogWriter, LevelV, AppendCauseV>(fileName, funcName, lineNo, nullptr, 0,
-                                                            this->_errnoIntroStr(initMsg).c_str(),
-                                                            fmt, std::forward<ArgTs>(args)...);
-    }
-
-    /*
-     * Logs the message of `errno` using the level `LevelV`.
-     *
-     * The log message starts with `initMsg`, is followed with the
-     * message for `errno`, and then with `msg`.
-     *
-     * If `AppendCauseV` is true, this method also appends a cause to
-     * the error of the current thread using the same message.
-     */
-    template <Level LevelV, bool AppendCauseV>
-    void logErrnoStr(const char * const fileName, const char * const funcName,
-                     const unsigned int lineNo, const char * const initMsg,
-                     const char * const msg) const
-    {
-        this->_logStr<_InitMsgLogWriter, LevelV, AppendCauseV>(
-            fileName, funcName, lineNo, nullptr, 0, this->_errnoIntroStr(initMsg).c_str(), msg);
+        this->_log<_InitMsgLogWriter, LevelV, AppendCauseV>(
+            fileName, funcName, lineNo, {}, this->_errnoIntroStr(initMsg).c_str(), std::move(fmt),
+            std::forward<ArgTs>(args)...);
     }
 
     /*
@@ -412,25 +348,11 @@ public:
     template <bool AppendCauseV, typename ExcT, typename... ArgTs>
     [[noreturn]] void logErrorErrnoAndThrow(const char * const fileName,
                                             const char * const funcName, const unsigned int lineNo,
-                                            const char * const initMsg, const char * const fmt,
-                                            ArgTs&&...args) const
+                                            const char * const initMsg,
+                                            fmt::format_string<ArgTs...> fmt, ArgTs&&...args) const
     {
-        this->logErrno<Level::Error, AppendCauseV>(fileName, funcName, lineNo, initMsg, fmt,
-                                                   std::forward<ArgTs>(args)...);
-        throw ExcT {};
-    }
-
-    /*
-     * Like logErrnoStr() with the `Level::Error` level, but also throws
-     * a default-constructed instance of `ExcT`.
-     */
-    template <bool AppendCauseV, typename ExcT>
-    [[noreturn]] void
-    logErrorErrnoStrAndThrow(const char * const fileName, const char * const funcName,
-                             const unsigned int lineNo, const char * const initMsg,
-                             const char * const msg) const
-    {
-        this->logErrnoStr<Level::Error, AppendCauseV>(fileName, funcName, lineNo, initMsg, msg);
+        this->logErrno<Level::Error, AppendCauseV>(fileName, funcName, lineNo, initMsg,
+                                                   std::move(fmt), std::forward<ArgTs>(args)...);
         throw ExcT {};
     }
 
@@ -438,27 +360,13 @@ public:
      * Like logErrno() with the `Level::Error` level, but also rethrows.
      */
     template <bool AppendCauseV, typename... ArgTs>
-    [[noreturn]] void logErrorErrnoAndRethrow(const char * const fileName,
-                                              const char * const funcName,
-                                              const unsigned int lineNo, const char * const initMsg,
-                                              const char * const fmt, ArgTs&&...args) const
-    {
-        this->logErrno<Level::Error, AppendCauseV>(fileName, funcName, lineNo, initMsg, fmt,
-                                                   std::forward<ArgTs>(args)...);
-        throw;
-    }
-
-    /*
-     * Like logErrnoStr() with the `Level::Error` level, but also
-     * rethrows.
-     */
-    template <bool AppendCauseV>
     [[noreturn]] void
-    logErrorErrnoStrAndRethrow(const char * const fileName, const char * const funcName,
-                               const unsigned int lineNo, const char * const initMsg,
-                               const char * const msg) const
+    logErrorErrnoAndRethrow(const char * const fileName, const char * const funcName,
+                            const unsigned int lineNo, const char * const initMsg,
+                            fmt::format_string<ArgTs...> fmt, ArgTs&&...args) const
     {
-        this->logErrnoStr<Level::Error, AppendCauseV>(fileName, funcName, lineNo, initMsg, msg);
+        this->logErrno<Level::Error, AppendCauseV>(fileName, funcName, lineNo, initMsg,
+                                                   std::move(fmt), std::forward<ArgTs>(args)...);
         throw;
     }
 
@@ -467,11 +375,10 @@ private:
     {
         static void write(const char * const fileName, const char * const funcName,
                           const unsigned lineNo, const Level level, const char * const tag,
-                          const void * const memData, const unsigned int memLen, const char *,
-                          const char * const msg) noexcept
+                          const MemData memData, const char *, const char * const msg) noexcept
         {
             bt_log_write_mem(funcName, fileName, lineNo, static_cast<bt_log_level>(level), tag,
-                             memData, memLen, msg);
+                             memData.data(), memData.size(), msg);
         }
     };
 
@@ -484,89 +391,66 @@ public:
      */
     template <Level LevelV, typename... ArgTs>
     void logMem(const char * const fileName, const char * const funcName, const unsigned int lineNo,
-                const void * const memData, const unsigned int memLen, const char * const fmt,
-                ArgTs&&...args) const
+                const MemData memData, fmt::format_string<ArgTs...> fmt, ArgTs&&...args) const
     {
-        this->_log<_MemLogWriter, LevelV, false>(fileName, funcName, lineNo, memData, memLen, "",
-                                                 fmt, std::forward<ArgTs>(args)...);
-    }
-
-    /*
-     * Logs memory data using the level `LevelV`, starting with the
-     * message `msg`.
-     */
-    template <Level LevelV>
-    void logMemStr(const char * const fileName, const char * const funcName,
-                   const unsigned int lineNo, const void * const memData, const unsigned int memLen,
-                   const char * const msg) const
-    {
-        this->_logStr<_MemLogWriter, LevelV, false>(fileName, funcName, lineNo, memData, memLen, "",
-                                                    msg);
+        this->_log<_MemLogWriter, LevelV, false>(fileName, funcName, lineNo, memData, "",
+                                                 std::move(fmt), std::forward<ArgTs>(args)...);
     }
 
 private:
     /*
      * Formats a log message with fmt::format() given `fmt` and `args`,
-     * and then forwards everything to _logStr().
+     * and then:
+     *
+     * 1. Calls LogWriterT::write() with its arguments to log using the
+     *    level `LevelV`.
+     *
+     * 2. If `AppendCauseV` is true, this method also appends a cause to
+     *    the error of the current thread using the concatenation of
+     *    `initMsg` and `msg` as the message.
      */
     template <typename LogWriterT, Level LevelV, bool AppendCauseV, typename... ArgTs>
     void _log(const char * const fileName, const char * const funcName, const unsigned int lineNo,
-              const void * const memData, const std::size_t memLen, const char * const initMsg,
-              const char * const fmt, ArgTs&&...args) const
+              const MemData memData, const char * const initMsg, fmt::format_string<ArgTs...> fmt,
+              ArgTs&&...args) const
     {
+        const auto wouldLog = this->wouldLog(LevelV);
+
         /* Only format arguments if logging or appending an error cause */
-        if (G_UNLIKELY(this->wouldLog(LevelV) || AppendCauseV)) {
+        if (G_UNLIKELY(wouldLog || AppendCauseV)) {
             /*
              * Format arguments to our buffer (fmt::format_to() doesn't
              * append a null character).
              */
             _mBuf.clear();
-            fmt::format_to(std::back_inserter(_mBuf), fmt, std::forward<ArgTs>(args)...);
+            fmt::format_to(std::back_inserter(_mBuf), std::move(fmt), std::forward<ArgTs>(args)...);
             _mBuf.push_back('\0');
         }
 
-        this->_logStr<LogWriterT, LevelV, AppendCauseV>(fileName, funcName, lineNo, memData, memLen,
-                                                        initMsg, _mBuf.data());
-    }
-
-    /*
-     * Calls LogWriterT::write() with its arguments to log using the
-     * level `LevelV`.
-     *
-     * If `AppendCauseV` is true, this method also appends a cause to
-     * the error of the current thread using the concatenation of
-     * `initMsg` and `msg` as the message.
-     */
-    template <typename LogWriterT, Level LevelV, bool AppendCauseV>
-    void _logStr(const char * const fileName, const char * const funcName,
-                 const unsigned int lineNo, const void * const memData, const std::size_t memLen,
-                 const char * const initMsg, const char * const msg) const
-    {
-        /* Initial message and main message are required */
+        /* Initial message is required */
         BT_ASSERT(initMsg);
-        BT_ASSERT(msg);
 
         /* Log if needed */
-        if (this->wouldLog(LevelV)) {
-            LogWriterT::write(fileName, funcName, lineNo, LevelV, _mTag.data(), memData, memLen,
-                              initMsg, msg);
+        if (wouldLog) {
+            LogWriterT::write(fileName, funcName, lineNo, LevelV, _mTag.data(), memData, initMsg,
+                              _mBuf.data());
         }
 
         /* 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, msg);
+                    _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, msg);
+                    _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, msg);
+                    _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, msg);
+                bt_current_thread_error_append_cause_from_unknown(
+                    _mModuleName->data(), fileName, lineNo, "%s%s", initMsg, _mBuf.data());
             }
         }
     }
@@ -593,6 +477,14 @@ private:
     mutable std::vector<char> _mBuf;
 };
 
+/*
+ * Returns `s` if it's not `nullptr`, or the `(null)` string otherwise.
+ */
+inline const char *maybeNull(const char * const s) noexcept
+{
+    return s ? s : "(null)";
+}
+
 } /* namespace bt2c */
 
 /* Internal: default logger name */
@@ -604,7 +496,8 @@ private:
 #define BT_CPPLOG_EX(_lvl, _logger, _fmt, ...)                                                     \
     do {                                                                                           \
         if (G_UNLIKELY((_logger).wouldLog(_lvl))) {                                                \
-            (_logger).log<(_lvl), false>(__FILE__, __func__, __LINE__, (_fmt), ##__VA_ARGS__);     \
+            (_logger).template log<(_lvl), false>(__FILE__, __func__, __LINE__, (_fmt),            \
+                                                  ##__VA_ARGS__);                                  \
         }                                                                                          \
     } while (0)
 
@@ -635,220 +528,102 @@ private:
 #define BT_CPPLOGE(_fmt, ...) BT_CPPLOGE_SPEC(_BT_CPPLOG_DEF_LOGGER, (_fmt), ##__VA_ARGS__)
 #define BT_CPPLOGF(_fmt, ...) BT_CPPLOGF_SPEC(_BT_CPPLOG_DEF_LOGGER, (_fmt), ##__VA_ARGS__)
 
-/*
- * Calls logStr() on `_logger` to log using the level `_lvl`.
- */
-#define BT_CPPLOG_STR_EX(_lvl, _logger, _msg)                                                      \
-    (_logger).logStr<(_lvl), false>(__FILE__, __func__, __LINE__, (_msg))
-
-/*
- * BT_CPPLOG_STR_EX() with specific logging levels.
- */
-#define BT_CPPLOGT_STR_SPEC(_logger, _msg)                                                         \
-    BT_CPPLOG_STR_EX(bt2c::Logger::Level::Trace, (_logger), (_msg))
-#define BT_CPPLOGD_STR_SPEC(_logger, _msg)                                                         \
-    BT_CPPLOG_STR_EX(bt2c::Logger::Level::Debug, (_logger), (_msg))
-#define BT_CPPLOGI_STR_SPEC(_logger, _msg)                                                         \
-    BT_CPPLOG_STR_EX(bt2c::Logger::Level::Info, (_logger), (_msg))
-#define BT_CPPLOGW_STR_SPEC(_logger, _msg)                                                         \
-    BT_CPPLOG_STR_EX(bt2c::Logger::Level::Warning, (_logger), (_msg))
-#define BT_CPPLOGE_STR_SPEC(_logger, _msg)                                                         \
-    BT_CPPLOG_STR_EX(bt2c::Logger::Level::Error, (_logger), (_msg))
-#define BT_CPPLOGF_STR_SPEC(_logger, _msg)                                                         \
-    BT_CPPLOG_STR_EX(bt2c::Logger::Level::Fatal, (_logger), (_msg))
-
-/*
- * BT_CPPLOG_STR_EX() with specific logging levels and using the default
- * logger.
- */
-#define BT_CPPLOGT_STR(_msg) BT_CPPLOGT_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-#define BT_CPPLOGD_STR(_msg) BT_CPPLOGD_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-#define BT_CPPLOGI_STR(_msg) BT_CPPLOGI_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-#define BT_CPPLOGW_STR(_msg) BT_CPPLOGW_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-#define BT_CPPLOGE_STR(_msg) BT_CPPLOGE_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-#define BT_CPPLOGF_STR(_msg) BT_CPPLOGF_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-
 /*
  * Calls logMem() on `_logger` to log using the level `_lvl`.
  */
-#define BT_CPPLOG_MEM_EX(_lvl, _logger, _mem_data, _mem_len, _fmt, ...)                            \
+#define BT_CPPLOG_MEM_EX(_lvl, _logger, _memData, _fmt, ...)                                       \
     do {                                                                                           \
         if (G_UNLIKELY((_logger).wouldLog(_lvl))) {                                                \
-            (_logger).logMem<(_lvl)>(__FILE__, __func__, __LINE__, (_mem_data), (_mem_len),        \
-                                     (_fmt), ##__VA_ARGS__);                                       \
+            (_logger).template logMem<(_lvl)>(__FILE__, __func__, __LINE__, (_memData), (_fmt),    \
+                                              ##__VA_ARGS__);                                      \
         }                                                                                          \
     } while (0)
 
 /*
  * BT_CPPLOG_MEM_EX() with specific logging levels.
  */
-#define BT_CPPLOGT_MEM_SPEC(_logger, _mem_data, _mem_len, _fmt, ...)                               \
-    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Trace, (_logger), (_mem_data), (_mem_len), (_fmt),       \
-                     ##__VA_ARGS__)
-#define BT_CPPLOGD_MEM_SPEC(_logger, _mem_data, _mem_len, _fmt, ...)                               \
-    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Debug, (_logger), (_mem_data), (_mem_len), (_fmt),       \
-                     ##__VA_ARGS__)
-#define BT_CPPLOGI_MEM_SPEC(_logger, _mem_data, _mem_len, _fmt, ...)                               \
-    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Info, (_logger), (_mem_data), (_mem_len), (_fmt),        \
-                     ##__VA_ARGS__)
-#define BT_CPPLOGW_MEM_SPEC(_logger, _mem_data, _mem_len, _fmt, ...)                               \
-    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Warning, (_logger), (_mem_data), (_mem_len), (_fmt),     \
-                     ##__VA_ARGS__)
-#define BT_CPPLOGE_MEM_SPEC(_logger, _mem_data, _mem_len, _fmt, ...)                               \
-    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Error, (_logger), (_mem_data), (_mem_len), (_fmt),       \
-                     ##__VA_ARGS__)
-#define BT_CPPLOGF_MEM_SPEC(_logger, _mem_data, _mem_len, _fmt, ...)                               \
-    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Fatal, (_logger), (_mem_data), (_mem_len), (_fmt),       \
-                     ##__VA_ARGS__)
+#define BT_CPPLOGT_MEM_SPEC(_logger, _memData, _fmt, ...)                                          \
+    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Trace, (_logger), (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGD_MEM_SPEC(_logger, _memData, _fmt, ...)                                          \
+    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Debug, (_logger), (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGI_MEM_SPEC(_logger, _memData, _fmt, ...)                                          \
+    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Info, (_logger), (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGW_MEM_SPEC(_logger, _memData, _fmt, ...)                                          \
+    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Warning, (_logger), (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGE_MEM_SPEC(_logger, _memData, _fmt, ...)                                          \
+    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Error, (_logger), (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGF_MEM_SPEC(_logger, _memData, _fmt, ...)                                          \
+    BT_CPPLOG_MEM_EX(bt2c::Logger::Level::Fatal, (_logger), (_memData), (_fmt), ##__VA_ARGS__)
 
 /*
  * BT_CPPLOG_MEM_EX() with specific logging levels and using the default
  * logger.
  */
-#define BT_CPPLOGT_MEM(_mem_data, _mem_len, _fmt, ...)                                             \
-    BT_CPPLOGT_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGD_MEM(_mem_data, _mem_len, _fmt, ...)                                             \
-    BT_CPPLOGD_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGI_MEM(_mem_data, _mem_len, _fmt, ...)                                             \
-    BT_CPPLOGI_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGW_MEM(_mem_data, _mem_len, _fmt, ...)                                             \
-    BT_CPPLOGW_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGE_MEM(_mem_data, _mem_len, _fmt, ...)                                             \
-    BT_CPPLOGE_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGF_MEM(_mem_data, _mem_len, _fmt, ...)                                             \
-    BT_CPPLOGF_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_fmt), ##__VA_ARGS__)
-
-/*
- * Calls logMemStr() on `_logger` to log using the level `_lvl`.
- */
-#define BT_CPPLOG_MEM_STR_EX(_lvl, _logger, _mem_data, _mem_len, _msg)                             \
-    (_logger).logMemStr<(_lvl)>(__FILE__, __func__, __LINE__, (_mem_data), (_mem_len), (_msg))
-
-/*
- * BT_CPPLOG_MEM_STR_EX() with specific logging levels.
- */
-#define BT_CPPLOGT_MEM_STR_SPEC(_logger, _mem_data, _mem_len, _msg)                                \
-    BT_CPPLOG_MEM_STR_EX(bt2c::Logger::Level::TRACE, (_logger), (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGD_MEM_STR_SPEC(_logger, _mem_data, _mem_len, _msg)                                \
-    BT_CPPLOG_MEM_STR_EX(bt2c::Logger::Level::DEBUG, (_logger), (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGI_MEM_STR_SPEC(_logger, _mem_data, _mem_len, _msg)                                \
-    BT_CPPLOG_MEM_STR_EX(bt2c::Logger::Level::INFO, (_logger), (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGW_MEM_STR_SPEC(_logger, _mem_data, _mem_len, _msg)                                \
-    BT_CPPLOG_MEM_STR_EX(bt2c::Logger::Level::WARNING, (_logger), (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGE_MEM_STR_SPEC(_logger, _mem_data, _mem_len, _msg)                                \
-    BT_CPPLOG_MEM_STR_EX(bt2c::Logger::Level::Error, (_logger), (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGF_MEM_STR_SPEC(_logger, _mem_data, _mem_len, _msg)                                \
-    BT_CPPLOG_MEM_STR_EX(bt2c::Logger::Level::FATAL, (_logger), (_mem_data), (_mem_len), (_msg))
-
-/*
- * BT_CPPLOG_MEM_STR_EX() with specific logging levels and using the
- * default logger.
- */
-#define BT_CPPLOGT_MEM_STR(_mem_data, _mem_len, _msg)                                              \
-    BT_CPPLOGT_MEM_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGD_MEM_STR(_mem_data, _mem_len, _msg)                                              \
-    BT_CPPLOGD_MEM_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGI_MEM_STR(_mem_data, _mem_len, _msg)                                              \
-    BT_CPPLOGI_MEM_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGW_MEM_STR(_mem_data, _mem_len, _msg)                                              \
-    BT_CPPLOGW_MEM_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGE_MEM_STR(_mem_data, _mem_len, _msg)                                              \
-    BT_CPPLOGE_MEM_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_msg))
-#define BT_CPPLOGF_MEM_STR(_mem_data, _mem_len, _msg)                                              \
-    BT_CPPLOGF_MEM_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_mem_data), (_mem_len), (_msg))
+#define BT_CPPLOGT_MEM(_memData, _fmt, ...)                                                        \
+    BT_CPPLOGT_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGD_MEM(_memData, _fmt, ...)                                                        \
+    BT_CPPLOGD_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGI_MEM(_memData, _fmt, ...)                                                        \
+    BT_CPPLOGI_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGW_MEM(_memData, _fmt, ...)                                                        \
+    BT_CPPLOGW_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGE_MEM(_memData, _fmt, ...)                                                        \
+    BT_CPPLOGE_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_memData), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGF_MEM(_memData, _fmt, ...)                                                        \
+    BT_CPPLOGF_MEM_SPEC(_BT_CPPLOG_DEF_LOGGER, (_memData), (_fmt), ##__VA_ARGS__)
 
 /*
  * Calls logErrno() on `_logger` to log using the level `_lvl` and
- * initial message `_init_msg`.
+ * initial message `_initMsg`.
  */
-#define BT_CPPLOG_ERRNO_EX(_lvl, _logger, _init_msg, _fmt, ...)                                    \
+#define BT_CPPLOG_ERRNO_EX(_lvl, _logger, _initMsg, _fmt, ...)                                     \
     do {                                                                                           \
         if (G_UNLIKELY((_logger).wouldLog(_lvl))) {                                                \
-            (_logger).logErrno<(_lvl), false>(__FILE__, __func__, __LINE__, (_init_msg), (_fmt),   \
-                                              ##__VA_ARGS__);                                      \
+            (_logger).template logErrno<(_lvl), false>(__FILE__, __func__, __LINE__, (_initMsg),   \
+                                                       (_fmt), ##__VA_ARGS__);                     \
         }                                                                                          \
     } while (0)
 
 /*
  * BT_CPPLOG_ERRNO_EX() with specific logging levels.
  */
-#define BT_CPPLOGT_ERRNO_SPEC(_logger, _init_msg, _fmt, ...)                                       \
-    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Trace, (_logger), (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGD_ERRNO_SPEC(_logger, _init_msg, _fmt, ...)                                       \
-    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Debug, (_logger), (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGI_ERRNO_SPEC(_logger, _init_msg, _fmt, ...)                                       \
-    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Info, (_logger), (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGW_ERRNO_SPEC(_logger, _init_msg, _fmt, ...)                                       \
-    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Warning, (_logger), (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGE_ERRNO_SPEC(_logger, _init_msg, _fmt, ...)                                       \
-    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Error, (_logger), (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGF_ERRNO_SPEC(_logger, _init_msg, _fmt, ...)                                       \
-    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Fatal, (_logger), (_init_msg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGT_ERRNO_SPEC(_logger, _initMsg, _fmt, ...)                                        \
+    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Trace, (_logger), (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGD_ERRNO_SPEC(_logger, _initMsg, _fmt, ...)                                        \
+    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Debug, (_logger), (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGI_ERRNO_SPEC(_logger, _initMsg, _fmt, ...)                                        \
+    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Info, (_logger), (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGW_ERRNO_SPEC(_logger, _initMsg, _fmt, ...)                                        \
+    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Warning, (_logger), (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGE_ERRNO_SPEC(_logger, _initMsg, _fmt, ...)                                        \
+    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Error, (_logger), (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGF_ERRNO_SPEC(_logger, _initMsg, _fmt, ...)                                        \
+    BT_CPPLOG_ERRNO_EX(bt2c::Logger::Level::Fatal, (_logger), (_initMsg), (_fmt), ##__VA_ARGS__)
 
 /*
  * BT_CPPLOG_ERRNO_EX() with specific logging levels and using the
  * default logger.
  */
-#define BT_CPPLOGT_ERRNO(_init_msg, _fmt, ...)                                                     \
-    BT_CPPLOGT_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGD_ERRNO(_init_msg, _fmt, ...)                                                     \
-    BT_CPPLOGD_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGI_ERRNO(_init_msg, _fmt, ...)                                                     \
-    BT_CPPLOGI_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGW_ERRNO(_init_msg, _fmt, ...)                                                     \
-    BT_CPPLOGW_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGE_ERRNO(_init_msg, _fmt, ...)                                                     \
-    BT_CPPLOGE_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt), ##__VA_ARGS__)
-#define BT_CPPLOGF_ERRNO(_init_msg, _fmt, ...)                                                     \
-    BT_CPPLOGF_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt), ##__VA_ARGS__)
-
-/*
- * Calls logErrnoStr() on `_logger` to log using the level `_lvl` and
- * initial message `_init_msg`.
- */
-#define BT_CPPLOG_ERRNO_STR_EX(_lvl, _logger, _init_msg, _msg)                                     \
-    (_logger).logErrnoStr<(_lvl), false>(__FILE__, __func__, __LINE__, (_init_msg), (_msg))
-
-/*
- * BT_CPPLOG_ERRNO_STR_EX() with specific logging levels.
- */
-#define BT_CPPLOGT_ERRNO_STR_SPEC(_logger, _init_msg, _msg)                                        \
-    BT_CPPLOG_ERRNO_STR_EX(bt2c::Logger::Level::Trace, (_logger), (_init_msg), (_msg))
-#define BT_CPPLOGD_ERRNO_STR_SPEC(_logger, _init_msg, _msg)                                        \
-    BT_CPPLOG_ERRNO_STR_EX(bt2c::Logger::Level::Debug, (_logger), (_init_msg), (_msg))
-#define BT_CPPLOGI_ERRNO_STR_SPEC(_logger, _init_msg, _msg)                                        \
-    BT_CPPLOG_ERRNO_STR_EX(bt2c::Logger::Level::Info, (_logger), (_init_msg), (_msg))
-#define BT_CPPLOGW_ERRNO_STR_SPEC(_logger, _init_msg, _msg)                                        \
-    BT_CPPLOG_ERRNO_STR_EX(bt2c::Logger::Level::Warning, (_logger), (_init_msg), (_msg))
-#define BT_CPPLOGE_ERRNO_STR_SPEC(_logger, _init_msg, _msg)                                        \
-    BT_CPPLOG_ERRNO_STR_EX(bt2c::Logger::Level::Error, (_logger), (_init_msg), (_msg))
-#define BT_CPPLOGF_ERRNO_STR_SPEC(_logger, _init_msg, _msg)                                        \
-    BT_CPPLOG_ERRNO_STR_EX(bt2c::Logger::Level::Fatal, (_logger), (_init_msg), (_msg))
-
-/*
- * BT_CPPLOG_ERRNO_STR_EX() with specific logging levels and using the
- * default logger.
- */
-#define BT_CPPLOGT_ERRNO_STR(_init_msg, _msg)                                                      \
-    BT_CPPLOGT_ERRNO_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
-#define BT_CPPLOGD_ERRNO_STR(_init_msg, _msg)                                                      \
-    BT_CPPLOGD_ERRNO_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
-#define BT_CPPLOGI_ERRNO_STR(_init_msg, _msg)                                                      \
-    BT_CPPLOGI_ERRNO_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
-#define BT_CPPLOGW_ERRNO_STR(_init_msg, _msg)                                                      \
-    BT_CPPLOGW_ERRNO_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
-#define BT_CPPLOGE_ERRNO_STR(_init_msg, _msg)                                                      \
-    BT_CPPLOGE_ERRNO_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
-#define BT_CPPLOGF_ERRNO_STR(_init_msg, _msg)                                                      \
-    BT_CPPLOGF_ERRNO_STR_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
+#define BT_CPPLOGT_ERRNO(_initMsg, _fmt, ...)                                                      \
+    BT_CPPLOGT_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGD_ERRNO(_initMsg, _fmt, ...)                                                      \
+    BT_CPPLOGD_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGI_ERRNO(_initMsg, _fmt, ...)                                                      \
+    BT_CPPLOGI_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGW_ERRNO(_initMsg, _fmt, ...)                                                      \
+    BT_CPPLOGW_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGE_ERRNO(_initMsg, _fmt, ...)                                                      \
+    BT_CPPLOGE_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGF_ERRNO(_initMsg, _fmt, ...)                                                      \
+    BT_CPPLOGF_ERRNO_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt), ##__VA_ARGS__)
 
 /*
  * Calls log() on `_logger` with the `Error` level to log an error and
  * append a cause to the error of the current thread.
  */
 #define BT_CPPLOGE_APPEND_CAUSE_SPEC(_logger, _fmt, ...)                                           \
-    (_logger).log<bt2c::Logger::Level::Error, true>(__FILE__, __func__, __LINE__, (_fmt),          \
-                                                    ##__VA_ARGS__)
+    (_logger).template log<bt2c::Logger::Level::Error, true>(__FILE__, __func__, __LINE__, (_fmt), \
+                                                             ##__VA_ARGS__)
 
 /*
  * BT_CPPLOGE_APPEND_CAUSE_SPEC() using the default logger.
@@ -856,55 +631,28 @@ private:
 #define BT_CPPLOGE_APPEND_CAUSE(_fmt, ...)                                                         \
     BT_CPPLOGE_APPEND_CAUSE_SPEC(_BT_CPPLOG_DEF_LOGGER, (_fmt), ##__VA_ARGS__)
 
-/*
- * Calls logStr() on `_logger` with the `Error` level to log an error and
- * append a cause to the error of the current thread.
- */
-#define BT_CPPLOGE_STR_APPEND_CAUSE_SPEC(_logger, _msg)                                            \
-    (_logger).logStr<bt2c::Logger::Level::Error, true>(__FILE__, __func__, __LINE__, (_msg))
-
-/*
- * BT_CPPLOGE_STR_APPEND_CAUSE_SPEC() using the default logger.
- */
-#define BT_CPPLOGE_STR_APPEND_CAUSE(_msg)                                                          \
-    BT_CPPLOGE_STR_APPEND_CAUSE_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-
 /*
  * Calls logErrorAndThrow() on `_logger` to log an error, append a cause
  * to the error of the current thread, and throw an instance of
- * `_exc_cls`.
+ * `_excCls`.
  */
-#define BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC(_logger, _exc_cls, _fmt, ...)                       \
-    (_logger).logErrorAndThrow<true, _exc_cls>(__FILE__, __func__, __LINE__, (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC(_logger, _excCls, _fmt, ...)                        \
+    (_logger).template logErrorAndThrow<true, _excCls>(__FILE__, __func__, __LINE__, (_fmt),       \
+                                                       ##__VA_ARGS__)
 
 /*
  * BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC() using the default logger.
  */
-#define BT_CPPLOGE_APPEND_CAUSE_AND_THROW(_exc_cls, _fmt, ...)                                     \
-    BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC(_BT_CPPLOG_DEF_LOGGER, _exc_cls, (_fmt), ##__VA_ARGS__)
-
-/*
- * Calls logErrorStrAndThrow() on `_logger` to log an error, append a
- * cause to the error of the current thread, and throw an instance of
- * `_exc_cls`.
- */
-#define BT_CPPLOGE_STR_APPEND_CAUSE_AND_THROW_SPEC(_logger, _exc_cls, _msg)                        \
-    (_logger).logErrorStrAndThrow<true, _exc_cls>(__FILE__, __func__, __LINE__, (_msg))
-
-/*
- * BT_CPPLOGE_STR_APPEND_CAUSE_AND_THROW_SPEC() using the default
- * logger.
- */
-#define BT_CPPLOGE_STR_APPEND_CAUSE_AND_THROW(_exc_cls, _msg)                                      \
-    BT_CPPLOGE_STR_APPEND_CAUSE_AND_THROW_SPEC(_BT_CPPLOG_DEF_LOGGER, _exc_cls, (_msg))
+#define BT_CPPLOGE_APPEND_CAUSE_AND_THROW(_excCls, _fmt, ...)                                      \
+    BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC(_BT_CPPLOG_DEF_LOGGER, _excCls, (_fmt), ##__VA_ARGS__)
 
 /*
  * Calls logErrorAndRethrow() on `_logger` to log an error, append a
  * cause to the error of the current thread, and throw an instance of
- * `_exc_cls`.
+ * `_excCls`.
  */
 #define BT_CPPLOGE_APPEND_CAUSE_AND_RETHROW_SPEC(_logger, _fmt, ...)                               \
-    (_logger).logErrorAndRethrow<true>(__FILE__, __func__, __LINE__, (_fmt), ##__VA_ARGS__)
+    (_logger).template logErrorAndRethrow<true>(__FILE__, __func__, __LINE__, (_fmt), ##__VA_ARGS__)
 
 /*
  * BT_CPPLOGE_APPEND_CAUSE_AND_RETHROW_SPEC() using the default logger.
@@ -912,113 +660,52 @@ private:
 #define BT_CPPLOGE_APPEND_CAUSE_AND_RETHROW(_fmt, ...)                                             \
     BT_CPPLOGE_APPEND_CAUSE_AND_RETHROW_SPEC(_BT_CPPLOG_DEF_LOGGER, (_fmt), ##__VA_ARGS__)
 
-/*
- * Calls logErrorStrAndRethrow() on `_logger` to log an error, append a
- * cause to the error of the current thread, and throw an instance of
- * `_exc_cls`.
- */
-#define BT_CPPLOGE_STR_APPEND_CAUSE_AND_RETHROW_SPEC(_logger, _msg)                                \
-    (_logger).logErrorStrAndRethrow<true>(__FILE__, __func__, __LINE__, (_msg))
-
-/*
- * BT_CPPLOGE_STR_APPEND_CAUSE_AND_RETHROW_SPEC() using the default
- * logger.
- */
-#define BT_CPPLOGE_STR_APPEND_CAUSE_AND_RETHROW(_msg)                                              \
-    BT_CPPLOGE_STR_APPEND_CAUSE_AND_RETHROW_SPEC(_BT_CPPLOG_DEF_LOGGER, (_msg))
-
 /*
  * Calls logErrno() on `_logger` with the `Level::Error` level to log an
  * error and append a cause to the error of the current thread.
  */
-#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_SPEC(_logger, _init_msg, _fmt, ...)                          \
-    (_logger).logErrno<bt2c::Logger::Level::Error, true>(__FILE__, __func__, __LINE__,             \
-                                                         (_init_msg), (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_SPEC(_logger, _initMsg, _fmt, ...)                           \
+    (_logger).template logErrno<bt2c::Logger::Level::Error, true>(                                 \
+        __FILE__, __func__, __LINE__, (_initMsg), (_fmt), ##__VA_ARGS__)
 
 /*
  * BT_CPPLOGE_ERRNO_APPEND_CAUSE_SPEC() using the default logger.
  */
-#define BT_CPPLOGE_ERRNO_APPEND_CAUSE(_init_msg, _fmt, ...)                                        \
-    BT_CPPLOGE_ERRNO_APPEND_CAUSE_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt), ##__VA_ARGS__)
-
-/*
- * Calls logErrnoStr() on `_logger` with the `Level::Error` level to log
- * an error and append a cause to the error of the current thread.
- */
-#define BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_SPEC(_logger, _init_msg, _msg)                           \
-    (_logger).logErrnoStr<bt2c::Logger::Level::Error, true>(__FILE__, __func__, __LINE__,          \
-                                                            (_init_msg), (_msg))
-
-/*
- * BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_SPEC() using the default logger.
- */
-#define BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE(_init_msg, _msg)                                         \
-    BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
+#define BT_CPPLOGE_ERRNO_APPEND_CAUSE(_initMsg, _fmt, ...)                                         \
+    BT_CPPLOGE_ERRNO_APPEND_CAUSE_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt), ##__VA_ARGS__)
 
 /*
  * Calls logErrorErrnoAndThrow() on `_logger` to log an error, append a
  * cause to the error of the current thread, and throw an instance of
- * `_exc_cls`.
+ * `_excCls`.
  */
-#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_THROW_SPEC(_logger, _exc_cls, _init_msg, _fmt, ...)      \
-    (_logger).logErrorErrnoAndThrow<true, _exc_cls>(__FILE__, __func__, __LINE__, (_init_msg),     \
-                                                    (_fmt), ##__VA_ARGS__)
+#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_THROW_SPEC(_logger, _excCls, _initMsg, _fmt, ...)        \
+    (_logger).template logErrorErrnoAndThrow<true, _excCls>(__FILE__, __func__, __LINE__,          \
+                                                            (_initMsg), (_fmt), ##__VA_ARGS__)
 
 /*
  * BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_THROW_SPEC() using the default
  * logger.
  */
-#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_THROW(_exc_cls, _init_msg, _fmt, ...)                    \
-    BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_THROW_SPEC(_BT_CPPLOG_DEF_LOGGER, _exc_cls, (_init_msg),     \
+#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_THROW(_excCls, _initMsg, _fmt, ...)                      \
+    BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_THROW_SPEC(_BT_CPPLOG_DEF_LOGGER, _excCls, (_initMsg),       \
                                                  (_fmt), ##__VA_ARGS__)
 
-/*
- * Calls logErrorErrnoStrAndThrow() on `_logger` to log an error, append
- * a cause to the error of the current thread, and throw an instance of
- * `_exc_cls`.
- */
-#define BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_THROW_SPEC(_logger, _exc_cls, _init_msg, _msg)       \
-    (_logger).logErrorErrnoStrAndThrow<true, _exc_cls>(__FILE__, __func__, __LINE__, (_init_msg),  \
-                                                       (_msg))
-
-/*
- * BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_THROW_SPEC() using the default
- * logger.
- */
-#define BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_THROW(_exc_cls, _init_msg, _msg)                     \
-    BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_THROW_SPEC(_BT_CPPLOG_DEF_LOGGER, _exc_cls, (_init_msg), \
-                                                     (_msg))
-
 /*
  * Calls logErrorErrnoAndRethrow() on `_logger` to log an error, append
  * a cause to the error of the current thread, and throw an instance of
- * `_exc_cls`.
+ * `_excCls`.
  */
-#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_RETHROW_SPEC(_logger, _init_msg, _fmt, ...)              \
-    (_logger).logErrorErrnoAndRethrow<true>(__FILE__, __func__, __LINE__, (_init_msg), (_fmt),     \
-                                            ##__VA_ARGS__)
+#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_RETHROW_SPEC(_logger, _initMsg, _fmt, ...)               \
+    (_logger).template logErrorErrnoAndRethrow<true>(__FILE__, __func__, __LINE__, (_initMsg),     \
+                                                     (_fmt), ##__VA_ARGS__)
 
 /*
  * BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_RETHROW_SPEC() using the default
  * logger.
  */
-#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_RETHROW(_init_msg, _fmt, ...)                            \
-    BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_RETHROW_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_fmt),     \
+#define BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_RETHROW(_initMsg, _fmt, ...)                             \
+    BT_CPPLOGE_ERRNO_APPEND_CAUSE_AND_RETHROW_SPEC(_BT_CPPLOG_DEF_LOGGER, (_initMsg), (_fmt),      \
                                                    ##__VA_ARGS__)
 
-/*
- * Calls logErrorErrnoStrAndRethrow() on `_logger` to log an error,
- * append a cause to the error of the current thread, and throw an
- * instance of `_exc_cls`.
- */
-#define BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_RETHROW_SPEC(_logger, _init_msg, _msg)               \
-    (_logger).logErrorErrnoStrAndRethrow<true>(__FILE__, __func__, __LINE__, (_init_msg), (_msg))
-
-/*
- * BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_RETHROW_SPEC() using the
- * default logger.
- */
-#define BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_RETHROW(_init_msg, _msg)                             \
-    BT_CPPLOGE_ERRNO_STR_APPEND_CAUSE_AND_RETHROW_SPEC(_BT_CPPLOG_DEF_LOGGER, (_init_msg), (_msg))
-
 #endif /* BABELTRACE_CPP_COMMON_BT2C_LOGGING_HPP */
This page took 0.034558 seconds and 4 git commands to generate.