summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-08 17:33:28 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-08 17:33:28 +0800
commit6817bc18309f903a07cb86dbd13eeed97b1ca995 (patch)
treeeeed4a8ed2253f1a9d3a5906a20bbfc8d3a95900 /src/include
parent0ab6d527125669ca7a36e5b27ff429c0f402ba77 (diff)
downloadmrust-6817bc18309f903a07cb86dbd13eeed97b1ca995.tar.gz
Macro definitions now being used
Diffstat (limited to 'src/include')
-rw-r--r--src/include/debug.hpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/include/debug.hpp b/src/include/debug.hpp
index 4da63192..8376be07 100644
--- a/src/include/debug.hpp
+++ b/src/include/debug.hpp
@@ -26,23 +26,15 @@ struct RepeatLitStr
class TraceLog
{
- static unsigned int depth;
const char* m_tag;
public:
- TraceLog(const char* tag): m_tag(tag) { indent(); ::std::cout << ">> " << m_tag << ::std::endl; }
- ~TraceLog() { outdent(); ::std::cout << "<< " << m_tag << ::std::endl; }
-private:
- void indent()
- {
- for(unsigned int i = 0; i < depth; i ++)
- ::std::cout << " ";
- depth ++;
+ TraceLog(const char* tag): m_tag(tag) {
+ DEBUG(">> " << m_tag);
+ INDENT();
}
- void outdent()
- {
- depth --;
- for(unsigned int i = 0; i < depth; i ++)
- ::std::cout << " ";
+ ~TraceLog() {
+ UNINDENT();
+ DEBUG("<< " << m_tag);
}
};
#define TRACE_FUNCTION TraceLog _tf_(__func__)