in TeamCity.MSBuild.Logger/TeamCityHierarchicalMessageWriter.cs [196:206]
private string FormatMessage(MessageState messageState, MessageInfo messageInfo, string text) =>
messageState == MessageState.Normal && !string.IsNullOrWhiteSpace(text) && messageInfo.Color.HasValue ? $"\x001B[{_colorTheme.GetAnsiColor(messageInfo.Color.Value)}m{text}" : text;
private enum MessageState
{
Normal,
Warning,
Error
}