Пример #1
0
 public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
 {
     //Register for the ProjectStarted, TargetStarted, and ProjectFinished events
     eventSource.ProjectStarted  += new ProjectStartedEventHandler(eventSource_ProjectStarted);
     eventSource.TargetStarted   += new TargetStartedEventHandler(eventSource_TargetStarted);
     eventSource.ProjectFinished += new ProjectFinishedEventHandler(eventSource_ProjectFinished);
 }
        public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
        {
            eventSource.ProjectStarted  += new ProjectStartedEventHandler(eventSource_ProjectStarted);
            eventSource.ProjectFinished += new ProjectFinishedEventHandler(eventSource_ProjectFinished);

            eventSource.TargetStarted  += new TargetStartedEventHandler(eventSource_TargetStarted);
            eventSource.TargetFinished += new TargetFinishedEventHandler(eventSource_TargetFinished);

            eventSource.MessageRaised += new BuildMessageEventHandler(eventSource_MessageRaised);
            eventSource.WarningRaised += new BuildWarningEventHandler(eventSource_WarningRaised);
            eventSource.ErrorRaised   += new BuildErrorEventHandler(eventSource_ErrorRaised);
        }
 public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
 {
     if (eventSource == null)
     {
         throw new ArgumentNullException("eventSource");
     }
     if (!onlyErrors)
     {
         eventSource.MessageRaised += MessageRaised;
         eventSource.WarningRaised += WarningRaised;
     }
     eventSource.ErrorRaised += ErrorRaised;
 }
Пример #4
0
        public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
        {
            if (eventSource == null)
            {
                return;
            }
            ;

            //Register for the ProjectStarted, TargetStarted, and ProjectFinished events
            eventSource.ProjectStarted  += eventSource_ProjectStarted;
            eventSource.TargetStarted   += eventSource_TargetStarted;
            eventSource.ProjectFinished += eventSource_ProjectFinished;
            eventSource.MessageRaised   += eventSource_MessageRaised;
            eventSource.WarningRaised   += eventSource_WarningRaised;
            eventSource.ErrorRaised     += eventSource_ErrorRaised;
        }
        public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
        {
            // The name of the log file should be passed as the first item in the
            // "parameters" specification in the /logger switch.  It is required
            // to pass a log file to this logger. Other loggers may have zero or more than 
            // one parameters.
            if (null == Parameters)
            {
                throw new LoggerException("Log file was not set");
            }
            string[] parameters = Parameters.Split(';');
            
            string logFile = parameters[0];
            if (String.IsNullOrEmpty(logFile))
            {
                throw new LoggerException("Log file was not set.");
            }
            
            if (parameters.Length > 1)
            {
                throw new LoggerException("Too many parameters passed.");
            }

            Console.WriteLine($"using '{logFile}' as log file");
            
            ChromeTracer.Initialize(logFile);

            if (Verbosity >= LoggerVerbosity.Diagnostic)
            {
                eventSource.TaskStarted += TaskStarted;
                eventSource.TaskStarted += TaskFinished;
            }

            if (Verbosity >= LoggerVerbosity.Detailed)
            {
                eventSource.TargetStarted += TargetStarted;
                eventSource.TargetFinished += TargetFinished;
            }
            
            if (Verbosity >= LoggerVerbosity.Normal)
            {
                eventSource.ProjectStarted += ProjectStarted;
                eventSource.ProjectFinished += ProjectFinished;
            }
            
        }
Пример #6
0
        public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
        {
            //default value
            Append = false;

            ParseCustomParameters();
            base.Initialize(eventSource);

            if (string.IsNullOrEmpty(LogFile))
            {
                //apply the default value
                LogFile = "custom.build.log";
            }

            FileWriter           = new StreamWriter(LogFile, Append);
            FileWriter.AutoFlush = true;

            base.WriteHandler = new WriteHandler(HandleWrite);
        }
Пример #7
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Initializes logger instance.
        /// </summary>
        /// <param name="eventSource">Event source for the logger.</param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
        {
            eventSource.BuildFinished  += new BuildFinishedEventHandler(eventSource_BuildFinished);
            eventSource.BuildStarted   += new BuildStartedEventHandler(eventSource_BuildStarted);
            eventSource.WarningRaised  += new BuildWarningEventHandler(eventSource_WarningRaised);
            eventSource.ErrorRaised    += new BuildErrorEventHandler(eventSource_ErrorRaised);
            eventSource.TargetFinished += new TargetFinishedEventHandler(eventSource_TargetFinished);
            eventSource.TargetStarted  += new TargetStartedEventHandler(eventSource_TargetStarted);
            eventSource.MessageRaised  += new BuildMessageEventHandler(eventSource_MessageRaised);

            /*
             * eventSource.AnyEventRaised += new AnyEventHandler(eventSource_AnyEventRaised);
             * eventSource.CustomEventRaised += new CustomBuildEventHandler(eventSource_CustomEventRaised);
             * eventSource.ProjectFinished += new ProjectFinishedEventHandler(eventSource_ProjectFinished);
             * eventSource.ProjectStarted += new ProjectStartedEventHandler(eventSource_ProjectStarted);
             * eventSource.TaskFinished += new TaskFinishedEventHandler(eventSource_TaskFinished);
             * eventSource.TaskStarted += new TaskStartedEventHandler(eventSource_TaskStarted);
             */
        }
 public override void Initialize(Microsoft.Build.Framework.IEventSource eventSource)
 {
     //Register for the ProjectStarted, TargetStarted, and ProjectFinished events
     eventSource.ErrorRaised += EventSource_ErrorRaised;
 }
Пример #9
0
 public void Initialize(Microsoft.Build.Framework.IEventSource eventSource, int nodeCount)
 {
     Initialize(eventSource);
 }