diff options
author | John Hodge <tpg@mutabah.net> | 2016-06-10 13:36:12 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-06-10 13:36:12 +0800 |
commit | 91248863bcfba4cc97ae1d3a196fd3f0b2512551 (patch) | |
tree | 4794c6453e57a24cf825a97b5016440e17d25ff6 /src/include | |
parent | 2dfe4182cbd34a775b7bea479d54b789019c0204 (diff) | |
download | mrust-91248863bcfba4cc97ae1d3a196fd3f0b2512551.tar.gz |
HIR Typecheck - Hack up closure inferrence from Fn* traits
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/debug.hpp | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/src/include/debug.hpp b/src/include/debug.hpp index c9fd20eb..7e68bbfa 100644 --- a/src/include/debug.hpp +++ b/src/include/debug.hpp @@ -44,39 +44,13 @@ class TraceLog const char* m_tag; ::std::function<void(::std::ostream&)> m_ret; public: - TraceLog(const char* tag, ::std::string info, ::std::function<void(::std::ostream&)> ret): - m_tag(tag), - m_ret(ret) - { - DEBUG(" >> " << m_tag << "(" << info << ")"); - INDENT(); - } - TraceLog(const char* tag, ::std::string info): - m_tag(tag), - m_ret([](const auto&){}) - { - DEBUG(" >> " << m_tag << "(" << info << ")"); - INDENT(); - } - TraceLog(const char* tag): - m_tag(tag), - m_ret([](const auto&){}) - { - DEBUG(" >> " << m_tag); - INDENT(); - } - ~TraceLog() { - UNINDENT(); - if(debug_enabled()) { - auto& os = debug_output(g_debug_indent_level, "TraceLog"); - os << " << " << m_tag; - m_ret(os); - os << ::std::endl; - } - } + TraceLog(const char* tag, ::std::string info, ::std::function<void(::std::ostream&)> ret); + TraceLog(const char* tag, ::std::string info); + TraceLog(const char* tag); + ~TraceLog(); }; #define TRACE_FUNCTION TraceLog _tf_(__func__) #define TRACE_FUNCTION_F(ss) TraceLog _tf_(__func__, FMT(ss)) -#define TRACE_FUNCTION_FR(ss,ss2) TraceLog _tf_(__func__, FMT(ss), [&](::std::ostream&__os){ __os<<"(" << ss2 <<"}";}) +#define TRACE_FUNCTION_FR(ss,ss2) TraceLog _tf_(__func__, FMT(ss), [&](::std::ostream&__os){ __os << ss2;}) |