using System;
using System.Runtime.InteropServices;
+using System.Collections.Generic;
using System.IO;
using System.Security;
using Microsoft.Build.Framework;
bool performanceSummary;
bool showSummary;
bool skipProjectStartedText;
+ List<string> errors, warnings;
public ConsoleLogger ()
: this (LoggerVerbosity.Normal, null, null, null)
this.performanceSummary = false;
this.showSummary = true;
this.skipProjectStartedText = false;
+ errors = new List<string> ();
+ warnings = new List<string> ();
}
public void ApplyParameter (string parameterName,
}
if (performanceSummary == true) {
}
+
+ if (errors.Count > 0) {
+ WriteLine ("Errors:");
+ foreach (string error in errors)
+ WriteLine (error);
+ }
+
+ if (warnings.Count > 0) {
+ WriteLine ("Warnings:");
+ foreach (string warning in warnings)
+ WriteLine (warning);
+ }
+
if (showSummary == true){
TimeSpan timeElapsed = args.Timestamp - buildStart;
WriteLine (String.Format ("\t {0} Warning(s)", warningCount));
public void WarningHandler (object sender, BuildWarningEventArgs args)
{
- if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal))
- WriteLineWithoutIndent (FormatWarningEvent (args));
+ string msg = FormatWarningEvent (args);
+ if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal))
+ WriteLineWithoutIndent (msg);
+ warnings.Add (msg);
warningCount++;
}
public void ErrorHandler (object sender, BuildErrorEventArgs args)
{
+ string msg = FormatErrorEvent (args);
if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Minimal))
- WriteLineWithoutIndent (FormatErrorEvent (args));
+ WriteLineWithoutIndent (msg);
+ errors.Add (msg);
errorCount++;
}
{
// FIXME: show more complicated args
if (args.LineNumber != 0 && args.ColumnNumber != 0) {
- return String.Format ("{0}({1},{2}): {3} error {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
+ return String.Format ("{0}({1},{2}): {3} Error {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
args.Subcategory, args.Code, args.Message);
} else {
- return String.Format ("{0}: {1} error {2}: {3}", args.File, args.Subcategory, args.Code,
+ return String.Format ("{0}: {1} Error {2}: {3}", args.File, args.Subcategory, args.Code,
args.Message);
}
}
{
// FIXME: show more complicated args
if (args.LineNumber != 0 && args.ColumnNumber != 0) {
- return String.Format ("{0}({1},{2}): {3} warning {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
+ return String.Format ("{0}({1},{2}): {3} Warning {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
args.Subcategory, args.Code, args.Message);
} else {
- return String.Format ("{0}: {1} warning {2}: {3}", args.File, args.Subcategory, args.Code,
+ return String.Format ("{0}: {1} Warning {2}: {3}", args.File, args.Subcategory, args.Code,
args.Message);
}
}