Skip to content

Commit

Permalink
[xbuild] Reset ConsoleLogger when a build finishes.
Browse files Browse the repository at this point in the history
MSBuild hosts like monodevelop, which use the same logger
for multiple builds, get errors/warnings from older builds.
So, reset them whenever the BuildFinished event is raised.

ILogger.Shutdown () is invoked when the host is about to quit,
according to msdn, so can't use that.
  • Loading branch information
radical committed Oct 12, 2010
1 parent ac277b3 commit 010fd9b
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,25 @@ public void BuildStartedHandler (object sender, BuildStartedEventArgs args)
}

public void BuildFinishedHandler (object sender, BuildFinishedEventArgs args)
{
BuildFinishedHandlerActual (args);

// Reset
events.Clear ();
errorsTable.Clear ();
warningsTable.Clear ();
targetPerfTable.Clear ();
tasksPerfTable.Clear ();
errors.Clear ();
warnings.Clear ();

indent = 0;
errorCount = 0;
warningCount = 0;
projectFailed = false;
}

void BuildFinishedHandlerActual (BuildFinishedEventArgs args)
{
if (!IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) {
PopEvent (args);
Expand Down

0 comments on commit 010fd9b

Please sign in to comment.