#include <lttng/lttng-error.h>
#include <inttypes.h>
+#include <iostream>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
+namespace {
/*
* lttng_opt_abort_on_error: unset: -1, disabled: 0, enabled: 1.
* Controlled by the LTTNG_ABORT_ON_ERROR environment variable.
*/
-static int lttng_opt_abort_on_error = -1;
+int lttng_opt_abort_on_error = -1;
/* TLS variable that contains the time of one single log entry. */
DEFINE_URCU_TLS(struct log_time, error_log_time);
+} /* namespace */
+
DEFINE_URCU_TLS(const char *, logger_thread_name);
-const char *log_add_time(void)
+const char *log_add_time()
{
int ret;
struct tm tm, *res;
abort();
}
}
+
+[[noreturn]] void
+lttng::logging::details::die_formatting_exception(const char *format,
+ const std::exception& formatting_exception)
+{
+ std::cerr << "Error occurred while formatting logging message: msg=`" << format
+ << "`: " << formatting_exception.what();
+ abort();
+}