Print diagnostics with color from API

I am trying to print an error message from clang API with colored format,

From StringRef message filled with diagnostics data I try

clang::TextDiagnostic::printDiagnosticMessage(outs(), clang::DiagnosticsEngine::Level::Error, message, 0, console->width, true);

But I dont see any colors on the screen buffer, I have look around, but could not find examples of this task, does anybody know how to print colored errors and warnings given only the StringRef buffer?



What colors were you expecting? There is very little color formatting within the diagnostic message itself. From the code, it will bold text when the level is Error, Fatal, or Warning, but not for Note. After that, there is color for the template diffing, but besides that I don’t believe there is any other color.