summaryrefslogtreecommitdiff
path: root/tools/minicargo/debug.h
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-09-23 10:04:16 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-09-23 11:18:30 +0800
commit5d5431f1db9efba7939d5e86e3be7136e3ec39fe (patch)
treedb3444525b848135a8184bde34a8d551ac05190d /tools/minicargo/debug.h
parent03e8d3c89dcfe8ec1bc56023ebd877a7df7c903c (diff)
downloadmrust-5d5431f1db9efba7939d5e86e3be7136e3ec39fe.tar.gz
minicargo - Disable debug in toml parser
Diffstat (limited to 'tools/minicargo/debug.h')
-rw-r--r--tools/minicargo/debug.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/minicargo/debug.h b/tools/minicargo/debug.h
index 00cd1412..f723d359 100644
--- a/tools/minicargo/debug.h
+++ b/tools/minicargo/debug.h
@@ -9,9 +9,15 @@ extern void Debug_EnterScope(const char* name, dbg_cb_t );
extern void Debug_LeaveScope(const char* name, dbg_cb_t );
extern void Debug_Print(dbg_cb_t cb);
-#define DEBUG(fmt) do { Debug_Print([&](auto& os){ os << "DEBUG: " << fmt; }); } while(0)
-#define TODO(fmt) do { Debug_Print([&](auto& os){ os << "TODO: " << fmt; }); abort(); } while(0)
-#define TRACE_FUNCTION_F(fmt) DebugFunctionScope trace_function_hdr { __FUNCTION__, [&](auto& os){ os << fmt; } }
+#if defined(NOLOG)
+# define DEBUG(fmt) do { } while(0)
+# define TODO(fmt) do { } while(0)
+# define TRACE_FUNCTION_F(fmt) do{}while(0)
+#else
+# define DEBUG(fmt) do { Debug_Print([&](auto& os){ os << "DEBUG: " << fmt; }); } while(0)
+# define TODO(fmt) do { Debug_Print([&](auto& os){ os << "TODO: " << fmt; }); abort(); } while(0)
+# define TRACE_FUNCTION_F(fmt) DebugFunctionScope trace_function_hdr { __FUNCTION__, [&](auto& os){ os << fmt; } }
+#endif
namespace {
static inline void format_to_stream(::std::ostream& os) {