6 extern char log_thread_prefix;
7 extern int DEBUG_LEVEL;
9 struct locked_ostream {
12 locked_ostream(locked_ostream &&) = default;
13 ~locked_ostream() { s << std::endl; }
15 locked_ostream & operator<<(U && u) { s << u; return *this; }
18 locked_ostream && _log_prefix(locked_ostream && f, const string & file, const string & func);
19 locked_ostream && _log_member(locked_ostream && f, const void *ptr);
22 #define LOG_NONMEMBER _log_prefix(locked_ostream{std::cerr, _log_lock()}, __FILE__, __func__)
23 #define LOG _log_member(LOG_NONMEMBER, (const void *)this)
25 #define IF_LEVEL(level) if(DEBUG_LEVEL >= abs(level))