public void StatusEventRaised()

in src/StructuredLogger/Construction/Construction.cs [483:562]


        public void StatusEventRaised(object sender, BuildStatusEventArgs e)
        {
            try
            {
                lock (syncLock)
                {
                    if (e is ProjectEvaluationStartedEventArgs projectEvaluationStarted)
                    {
                        var evaluationId = projectEvaluationStarted.BuildEventContext.EvaluationId;
                        var projectFilePath = Intern(projectEvaluationStarted.ProjectFile);
                        var projectName = Intern(Path.GetFileName(projectFilePath));
                        var nodeName = Intern(GetEvaluationProjectName(evaluationId, projectName));
                        var projectEvaluation = new ProjectEvaluation { Name = nodeName };
                        EvaluationFolder.AddChild(projectEvaluation);
                        projectEvaluation.ProjectFile = projectFilePath;

                        projectEvaluation.Id = evaluationId;
                        projectEvaluation.EvaluationText = Intern("id:" + evaluationId);
                        projectEvaluation.NodeId = e.BuildEventContext.NodeId;
                        projectEvaluation.StartTime = e.Timestamp;
                        projectEvaluation.EndTime = e.Timestamp;
                    }
                    else if (e is ProjectEvaluationFinishedEventArgs projectEvaluationFinished)
                    {
                        var evaluationId = projectEvaluationFinished.BuildEventContext.EvaluationId;
                        var projectFilePath = Intern(projectEvaluationFinished.ProjectFile);
                        var projectName = Intern(Path.GetFileName(projectFilePath));
                        var nodeName = Intern(GetEvaluationProjectName(evaluationId, projectName));
                        var projectEvaluation = EvaluationFolder.FindLastChild<ProjectEvaluation>(e => e.Id == evaluationId);
                        if (projectEvaluation == null)
                        {
                            // no matching ProjectEvaluationStarted
                            return;
                        }

                        projectEvaluation.EndTime = e.Timestamp;

                        var profilerResult = projectEvaluationFinished.ProfilerResult;
                        if (profilerResult != null && projectName != null)
                        {
                            ConstructProfilerResult(projectEvaluation, profilerResult.Value);
                        }

                        // Pre-create folder before starting the fill on the background thread.
                        Folder globFolder = null;
                        Folder itemsNode = null;
                        Folder propertiesFolder = null;
                        if (projectEvaluationFinished.GlobalProperties != null)
                        {
                            globFolder = GetOrCreateGlobalPropertiesFolder(projectEvaluation, projectEvaluationFinished.GlobalProperties);
                        }

                        if (projectEvaluationFinished.Items != null)
                        {
                            itemsNode = projectEvaluation.GetOrCreateNodeWithName<Folder>(Strings.Items, addAtBeginning: true);
                        }

                        if (projectEvaluationFinished.Properties != null)
                        {
                            propertiesFolder = projectEvaluation.GetOrCreateNodeWithName<Folder>(Strings.Properties, addAtBeginning: true);
                        }

                        bgJobPool.Add(new System.Threading.Tasks.Task(() =>
                        {
                            if (projectEvaluationFinished.GlobalProperties != null && globFolder != null)
                            {
                                AddProperties(globFolder, (IEnumerable<KeyValuePair<string, string>>)projectEvaluationFinished.GlobalProperties, projectEvaluation);
                            }

                            AddProperties(propertiesFolder, projectEvaluation, projectEvaluationFinished.Properties);
                            AddItems(itemsNode, projectEvaluation, projectEvaluationFinished.Items);
                        }));
                    }
                }
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }
        }