X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/46fb2b4bbe3a0a8516ab04cfafa895a882c70f86..5d99dbf06a14904944f5593c63705934bdfdcfb7:/threaded_log.h diff --git a/threaded_log.h b/threaded_log.h index 706e2b7..750c5d2 100644 --- a/threaded_log.h +++ b/threaded_log.h @@ -11,8 +11,7 @@ extern int next_instance_num; extern char log_thread_prefix; namespace std { - // This is an awful hack. But sticking this in std:: makes it possible for - // ostream_iterator to use it. + // Sticking this in std:: makes it possible for ostream_iterator to use it. template ostream & operator<<(ostream &o, const pair &d) { return o << "<" << d.first << "," << d.second << ">"; @@ -26,7 +25,7 @@ operator<<(ostream &o, const A &a) { } #define LOG_PREFIX { \ - auto _thread_ = std::this_thread::get_id(); \ + auto _thread_ = this_thread::get_id(); \ int _tid_ = thread_name_map[_thread_]; \ if (_tid_==0) \ _tid_ = thread_name_map[_thread_] = ++next_thread_num; \ @@ -39,7 +38,7 @@ operator<<(ostream &o, const A &a) { int _self_ = instance_name_map[this]; \ if (_self_==0) \ _self_ = instance_name_map[this] = ++next_instance_num; \ - cerr << "#" << setw(2) << _self_; \ + cerr << "#" << setw(2) << " " << _self_; \ } #define LOG_NONMEMBER(_x_) { \