diff options
Diffstat (limited to 'src/debug.cpp')
-rw-r--r-- | src/debug.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/debug.cpp b/src/debug.cpp index a09fc648..d460c3cb 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -1,23 +1,27 @@ #include <debug.hpp> -TraceLog::TraceLog(const char* tag, ::std::string info, ::std::function<void(::std::ostream&)> ret): +TraceLog::TraceLog(const char* tag, ::std::function<void(::std::ostream&)> info_cb, ::std::function<void(::std::ostream&)> ret): m_tag(tag), m_ret(ret) { if(debug_enabled()) { auto& os = debug_output(g_debug_indent_level, m_tag); - os << ">> (" << info << ")" << ::std::endl; + os << ">> ("; + info_cb(os); + os << ")" << ::std::endl; } INDENT(); } -TraceLog::TraceLog(const char* tag, ::std::string info): +TraceLog::TraceLog(const char* tag, ::std::function<void(::std::ostream&)> info_cb): m_tag(tag), m_ret([](const auto&){}) { if(debug_enabled()) { auto& os = debug_output(g_debug_indent_level, m_tag); - os << ">> (" << info << ")" << ::std::endl; + os << ">> ("; + info_cb(os); + os << ")" << ::std::endl; } INDENT(); } |