char str[19];
};
-extern thread_local const char * logger_thread_name;
+extern thread_local const char *logger_thread_name;
extern int lttng_opt_quiet;
extern int lttng_opt_verbose;
} while (0);
#define _PERROR(fmt, args...) _ERRMSG("PERROR", PRINT_ERR, fmt, ##args)
+#define _PWARN(fmt, args...) _ERRMSG("PWARN", PRINT_WARN, fmt, ##args)
#if !defined(__GLIBC__) || \
((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
strerror_r(errno, _perror_buf, sizeof(_perror_buf)); \
_PERROR(call ": %s", ##args, _perror_buf); \
} while (0);
+
+#define PWARN(call, args...) \
+ do { \
+ char _perror_buf[200]; \
+ strerror_r(errno, _perror_buf, sizeof(_perror_buf)); \
+ _PWARN(call ": %s", ##args, _perror_buf); \
+ } while (0);
#else
/*
* Version using GNU strerror_r, for linux with appropriate defines.
*/
-const char *error_get_str(int32_t code);
#define PERROR(call, args...) \
do { \
char *_perror_buf; \
_perror_buf = strerror_r(errno, _perror_tmp, sizeof(_perror_tmp)); \
_PERROR(call ": %s", ##args, _perror_buf); \
} while (0);
+#define PWARN(call, args...) \
+ do { \
+ char *_perror_buf; \
+ char _perror_tmp[200]; \
+ _perror_buf = strerror_r(errno, _perror_tmp, sizeof(_perror_tmp)); \
+ _PWARN(call ": %s", ##args, _perror_buf); \
+ } while (0);
#endif
+const char *error_get_str(int32_t code);
+
namespace lttng {
namespace logging {
namespace details {
#define DBG_FMT(format_str, args...) \
do { \
try { \
- DBG("%s", fmt::format(format_str, ##args).c_str()); \
+ DBG("%s", lttng::format(format_str, ##args).c_str()); \
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
#define WARN_FMT(format_str, args...) \
do { \
try { \
- WARN("%s", fmt::format(format_str, ##args).c_str()); \
+ WARN("%s", lttng::format(format_str, ##args).c_str()); \
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
#define ERR_FMT(format_str, args...) \
do { \
try { \
- ERR("%s", fmt::format(format_str, ##args).c_str()); \
+ ERR("%s", lttng::format(format_str, ##args).c_str()); \
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \