Add debug logging facility

This commit is contained in:
Jonathan Müller 2017-04-06 12:09:29 +02:00
commit da5b46fdb7
4 changed files with 27 additions and 0 deletions

View file

@ -74,6 +74,15 @@ std::unique_ptr<cpp_entity> detail::parse_entity(const detail::parse_context& co
const CXCursor& cur,
const CXCursor& parent_cur) try
{
if (context.logger->is_verbose())
{
auto message = detail::format("parsing cursor of type '",
detail::get_cursor_kind_spelling(cur).c_str(), "'");
context.logger->log("libclang parser",
diagnostic{std::move(message), detail::make_location(cur),
severity::debug});
}
auto kind = clang_getCursorKind(cur);
switch (kind)
{