/// <summary> /// Forwards any event raised to the BuildEventRedirector, this redirector will send the event on a path which will /// take it to a logger. /// </summary> /// <param name="sender">Who sent the message, this is not used</param> /// <param name="buildEvent">BuildEvent to forward</param> private void EventSource_AnyEventRaised(object sender, BuildEventArgs buildEvent) { // If no central logger was registered with the system // there will not be a build event redirector as there is // nowhere to forward the events to. BuildEventRedirector?.ForwardEvent(buildEvent); }
public void Initialize(IEventSource eventSource) { // Only forward telemetry events if (eventSource is IEventSource2 eventSource2) { eventSource2.TelemetryLogged += (sender, args) => BuildEventRedirector.ForwardEvent(args); } }
public void Initialize(IEventSource eventSource) { // Declare lack of dependency on having properties/items in ProjectStarted events // (since this logger doesn't ever care about those events it's irrelevant) if (eventSource is IEventSource4 eventSource4) { eventSource4.IncludeEvaluationPropertiesAndItems(); } // Only forward telemetry events if (eventSource is IEventSource2 eventSource2) { eventSource2.TelemetryLogged += (sender, args) => BuildEventRedirector.ForwardEvent(args); } }