Slight update to log formatting (omitting warnings on errors)

This commit is contained in:
Rick Falkvinge
2016-09-27 12:34:00 +02:00
parent b72d6b060b
commit 9a496f30c0
2 changed files with 16 additions and 11 deletions
Binary file not shown.
+16 -11
View File
@@ -129,20 +129,25 @@ namespace XBuildLog2Xml
{
if (result.WarningsTotal + result.ErrorsTotal > 0)
{
xmlWriter.WriteStartElement ("project");
xmlWriter.WriteAttributeString ("name", result.ProjectName);
if (result.ErrorsTotal > 0)
if (result.ErrorsTotal > 0 && sumErrors > 0) // write only errors if there are any errors
{
xmlWriter.WriteStartElement ("project");
xmlWriter.WriteAttributeString ("name", result.ProjectName);
WriteXmlBuildMessages (xmlWriter, result.Errors);
}
else
{
WriteXmlBuildMessages (xmlWriter, result.CodeWarnings);
WriteXmlBuildMessages (xmlWriter, result.EnvironmentWarnings);
}
xmlWriter.WriteEndElement();
xmlWriter.WriteEndElement();
}
else if (result.WarningsTotal > 0 && sumErrors == 0) // if there are no errors in ANY project, write the warnings for all projects
{
xmlWriter.WriteStartElement("project");
xmlWriter.WriteAttributeString("name", result.ProjectName);
WriteXmlBuildMessages(xmlWriter, result.CodeWarnings);
WriteXmlBuildMessages(xmlWriter, result.EnvironmentWarnings);
xmlWriter.WriteEndElement();
}
}
}