Format preprocessor diagnostics

This commit is contained in:
Jonathan Müller 2017-02-19 20:51:08 +01:00
commit f66fa70b1f
3 changed files with 106 additions and 12 deletions

View file

@ -13,6 +13,7 @@ using namespace cppast;
bool stderr_diagnostic_logger::do_log(const char* source, const diagnostic& d) const
{
std::fprintf(stderr, "[%s] %s %s", source, d.location.to_string().c_str(), d.message.c_str());
std::fprintf(stderr, "[%s] [%s] %s %s\n", source, to_string(d.severity),
d.location.to_string().c_str(), d.message.c_str());
return true;
}