+#define DBG_FMT(format_str, args...) \
+ do { \
+ try { \
+ DBG("%s", fmt::format(format_str, ##args).c_str()); \
+ } catch (const std::exception& _formatting_exception) { \
+ lttng::logging::details::die_formatting_exception(format_str, \
+ _formatting_exception); \
+ } \
+ } while (0);
+
+#define WARN_FMT(format_str, args...) \
+ do { \
+ try { \
+ WARN("%s", fmt::format(format_str, ##args).c_str()); \
+ } catch (const std::exception& _formatting_exception) { \
+ lttng::logging::details::die_formatting_exception(format_str, \
+ _formatting_exception); \
+ } \
+ } while (0);
+
+#define ERR_FMT(format_str, args...) \
+ do { \
+ try { \
+ ERR("%s", fmt::format(format_str, ##args).c_str()); \
+ } catch (const std::exception& _formatting_exception) { \
+ lttng::logging::details::die_formatting_exception(format_str, \
+ _formatting_exception); \
+ } \
+ } while (0);