-#ifndef tprintf_h
-#define tprintf_h
+#ifndef threaded_log_h
+#define threaded_log_h
#include <iomanip>
#include <iostream>
extern int next_thread_num;
extern std::map<void *, int> instance_name_map;
extern int next_instance_num;
-extern char tprintf_thread_prefix;
+extern char log_thread_prefix;
template <class A>
struct iterator_pair : public std::pair<A, A> {
_tid_ = thread_name_map[_thread_] = ++next_thread_num; \
auto _utime_ = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()).count() % 1000000000; \
std::cerr << std::setfill('0') << std::dec << std::left << std::setw(9) << _utime_ << " "; \
- std::cerr << tprintf_thread_prefix << std::left << std::setw(2) << _tid_; \
+ std::cerr << std::setfill(' ') << log_thread_prefix << std::left << std::setw(2) << _tid_; \
std::cerr << " " << std::setw(20) << __FILE__ << " " << std::setw(18) << __func__; \
}
#define LOG_THIS_POINTER { \
LOG_SUFFIX; \
}
-#define tprintf(...) { \
- char *buf = nullptr; \
- int len = asprintf(&buf, __VA_ARGS__); \
- if (buf[len-1]=='\n') \
- buf[len-1] = '\0'; \
- LOG_NONMEMBER(buf); \
- free(buf); \
-}
-
#endif