BackEnd\BuildManager\BuildManager.cs (58)
573loggingService.LogComment(buildEventContext: BuildEventContext.Invalid, MessageImportance.Normal, "BuildCheckEnabled");
642loggingService.LogComment(BuildEventContext.Invalid, MessageImportance.Normal, "UsingInputCaches", string.Join(";", _buildParameters.InputResultsCacheFiles));
647loggingService.LogComment(BuildEventContext.Invalid, MessageImportance.Normal, "WritingToOutputCache", _buildParameters.OutputResultsCacheFile);
1048(_overallBuildSuccess && loggingService.HasBuildSubmissionLoggedErrors(BuildEventContext.InvalidSubmissionId)))
1389BuildEventContext buildEventContext = new BuildEventContext(
1392BuildEventContext.InvalidProjectInstanceId,
1393BuildEventContext.InvalidProjectContextId,
1394BuildEventContext.InvalidTargetId,
1395BuildEventContext.InvalidTaskId);
1480var buildEventContext = request.BuildEventContext;
1481if (buildEventContext == BuildEventContext.Invalid)
1483buildEventContext = new BuildEventContext(request.SubmissionId, 0, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
1745BuildEventContext buildEventContext = new BuildEventContext(submission.SubmissionId, 1, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
1767private static void AddBuildRequestToSubmission(BuildSubmission submission, int configurationId, int projectContextId = BuildEventContext.InvalidProjectContextId)
1775parentBuildEventContext: BuildEventContext.Invalid,
1854BuildEventContext projectBuildEventContext = new BuildEventContext(submission.SubmissionId, 1, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
1870var buildEventContext = new BuildEventContext(submission.SubmissionId, 1, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
1927BuildEventContext.InvalidEvaluationId,
1928BuildEventContext.InvalidProjectInstanceId,
1929BuildEventContext.InvalidProjectContextId,
1930BuildEventContext.InvalidTargetId,
1931BuildEventContext.InvalidTaskId),
2451BuildEventContext buildEventContext = _projectStartedEvents.TryGetValue(result.SubmissionId, out BuildEventArgs? buildEventArgs)
2453: new BuildEventContext(result.SubmissionId, node, configuration.Project?.EvaluationId ?? BuildEventContext.InvalidEvaluationId, configuration.ConfigurationId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
2492BuildEventContext buildEventContext = new BuildEventContext(submission.SubmissionId, BuildEventContext.InvalidNodeId, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
2503loggingService?.LogError(BuildEventContext.Invalid, new BuildEventFileInfo(string.Empty) /* no project file */, "ChildExitedPrematurely", node, ExceptionHandling.DebugDumpPath, shutdownPacket.Exception.ToString());
2648BuildEventContext buildEventContext = new BuildEventContext(0, Scheduler.VirtualNode, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
3073loggingService.LogCommentFromText(BuildEventContext.Invalid, message.Importance, message.Text);
3078loggingService.LogIncludeFile(BuildEventContext.Invalid, message.FilePath);
3234loggingService?.LogCommentFromText(BuildEventContext.Invalid, MessageImportance.High, message);
3242BuildEventContext.Invalid,
BackEnd\Components\Logging\ILoggingService.cs (45)
252/// <param name="buildEventContext">A <see cref="BuildEventContext"/> to associate with the list of warning codes.</param>
254void AddWarningsAsMessages(BuildEventContext buildEventContext, ISet<string> codes);
259/// <param name="buildEventContext">A <see cref="BuildEventContext"/> to associate with the list of warning codes.</param>
261void AddWarningsAsErrors(BuildEventContext buildEventContext, ISet<string> codes);
266/// <param name="buildEventContext">A <see cref="BuildEventContext"/> to associate with the list of warning codes.</param>
268void AddWarningsNotAsErrors(BuildEventContext buildEventContext, ISet<string> codes);
282ICollection<string> GetWarningsAsErrors(BuildEventContext context);
289ICollection<string> GetWarningsNotAsErrors(BuildEventContext context);
296ICollection<string> GetWarningsAsMessages(BuildEventContext context);
342void LogComment(BuildEventContext buildEventContext, MessageImportance importance, string messageResourceName, params object[] messageArgs);
350void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message);
362void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message, params object[] messageArgs);
381void LogError(BuildEventContext buildEventContext, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs);
391void LogError(BuildEventContext buildEventContext, string subcategoryResourceName, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs);
402void LogErrorFromText(BuildEventContext buildEventContext, string subcategoryResourceName, string errorCode, string helpKeyword, BuildEventFileInfo file, string message);
409void LogInvalidProjectFileError(BuildEventContext buildEventContext, InvalidProjectFileException invalidProjectFileException);
417void LogFatalBuildError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file);
426void LogFatalTaskError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName);
436void LogFatalError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs);
447void LogTaskWarningFromException(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName);
457void LogWarning(BuildEventContext buildEventContext, string subcategoryResourceName, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs);
468void LogWarningFromText(BuildEventContext buildEventContext, string subcategoryResourceName, string warningCode, string helpKeyword, BuildEventFileInfo file, string message);
494BuildEventContext CreateEvaluationBuildEventContext(int nodeId, int submissionId);
504BuildEventContext CreateProjectCacheBuildEventContext(int submissionId, int evaluationId, int projectInstanceId, string projectFile);
512void LogProjectEvaluationStarted(BuildEventContext eventContext, string projectFile);
525BuildEventContext projectEvaluationEventContext,
546BuildEventContext LogProjectStarted(
547BuildEventContext nodeBuildEventContext,
550BuildEventContext parentBuildEventContext,
555int evaluationId = BuildEventContext.InvalidEvaluationId,
556int projectContextId = BuildEventContext.InvalidProjectContextId);
561BuildEventContext nodeBuildEventContext,
564BuildEventContext parentBuildEventContext,
569int evaluationId = BuildEventContext.InvalidEvaluationId,
570int projectContextId = BuildEventContext.InvalidProjectContextId);
578void LogProjectFinished(BuildEventContext projectBuildEventContext, string projectFile, bool success);
590BuildEventContext LogTargetStarted(BuildEventContext projectBuildEventContext, string targetName, string projectFile, string projectFileOfTargetElement, string parentTargetName, TargetBuiltReason buildReason);
601void LogTargetFinished(BuildEventContext targetBuildEventContext, string targetName, string projectFile, string projectFileOfTargetElement, bool success, IEnumerable<TaskItem> targetOutputs);
611void LogTaskStarted(BuildEventContext taskBuildEventContext, string taskName, string projectFile, string projectFileOfTaskNode, string taskAssemblyLocation);
624BuildEventContext LogTaskStarted2(BuildEventContext targetBuildEventContext, string taskName, string projectFile, string projectFileOfTaskNode, int line, int column, string taskAssemblyLocation);
634void LogTaskFinished(BuildEventContext taskBuildEventContext, string taskName, string projectFile, string projectFileOfTaskNode, bool success);
644void LogTelemetry(BuildEventContext buildEventContext, string eventName, IDictionary<string, string> properties);
653void LogIncludeFile(BuildEventContext buildEventContext, string filePath);
BackEnd\Components\Logging\LoggingService.cs (24)
210/// A list of build submission IDs that have logged errors. If an error is logged outside of a submission, the submission ID is <see cref="BuildEventContext.InvalidSubmissionId"/>.
215/// A list of build submission IDs that have logged errors through buildcheck. If an error is logged outside of a submission, the submission ID is <see cref="BuildEventContext.InvalidSubmissionId"/>.
220/// A list of warnings to treat as errors for an associated <see cref="BuildEventContext"/>. If an empty set, all warnings are treated as errors.
225/// A list of warnings to not to be promoted to errors for an associated <see cref="BuildEventContext"/>.
230/// A list of warnings to treat as messages for an associated <see cref="BuildEventContext"/>.
649public ICollection<string> GetWarningsAsErrors(BuildEventContext context)
660public ICollection<string> GetWarningsNotAsErrors(BuildEventContext context)
671public ICollection<string> GetWarningsAsMessages(BuildEventContext context)
686private ICollection<string> GetWarningsForProject(BuildEventContext context, IDictionary<WarningsConfigKey, ISet<string>> warningsByProject, ISet<string> warnings)
710public void AddWarningsAsErrors(BuildEventContext buildEventContext, ISet<string> codes)
720public void AddWarningsNotAsErrors(BuildEventContext buildEventContext, ISet<string> codes)
730public void AddWarningsAsMessages(BuildEventContext buildEventContext, ISet<string> codes)
741private void AddWarningsAsMessagesOrErrors(ref IDictionary<WarningsConfigKey, ISet<string>> warningsByProject, BuildEventContext buildEventContext, ISet<string> codes)
990BuildEventContext buildEventContext = buildEvent?.BuildEventContext ?? BuildEventContext.Invalid;
1011if (warning.ProjectFile == null && buildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId)
1253if ((warningEvent = buildEvent as BuildWarningEventArgs) != null && warningEvent.BuildEventContext != null && warningEvent.BuildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId)
1257else if ((errorEvent = buildEvent as BuildErrorEventArgs) != null && errorEvent.BuildEventContext != null && errorEvent.BuildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId)
1261else if ((messageEvent = buildEvent as BuildMessageEventArgs) != null && messageEvent.BuildEventContext != null && messageEvent.BuildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId)
1370private static WarningsConfigKey GetWarningsConfigKey(BuildEventContext buildEventContext)
1656int submissionId = errorEvent.BuildEventContext?.SubmissionId ?? BuildEventContext.InvalidSubmissionId;
1930private string GetAndVerifyProjectFileFromContext(BuildEventContext context)
1957if (_warningsAsMessagesByProject != null && warningEvent.BuildEventContext != null && warningEvent.BuildEventContext.ProjectInstanceId != BuildEventContext.InvalidProjectInstanceId)
1994if (_warningsAsErrorsByProject != null && warningEvent.BuildEventContext != null && warningEvent.BuildEventContext.ProjectInstanceId != BuildEventContext.InvalidProjectInstanceId)
BackEnd\Components\Logging\LoggingServiceLogMethods.cs (52)
37public void LogComment(BuildEventContext buildEventContext, MessageImportance importance, string messageResourceName, params object[] messageArgs)
56public void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message)
71public void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message, params object[] messageArgs)
97public void LogError(BuildEventContext location, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs)
111public void LogError(BuildEventContext buildEventContext, string subcategoryResourceName, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs)
131public void LogErrorFromText(BuildEventContext buildEventContext, string subcategoryResourceName, string errorCode, string helpKeyword, BuildEventFileInfo file, string message)
135if (buildEvent.ProjectFile == null && buildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId)
154public void LogInvalidProjectFileError(BuildEventContext buildEventContext, InvalidProjectFileException invalidProjectFileException)
175if (buildEvent.ProjectFile == null && buildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId)
194public void LogFatalBuildError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file)
208public void LogFatalTaskError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName)
225public void LogFatalError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs)
259public void LogTaskWarningFromException(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName)
284public void LogWarning(BuildEventContext buildEventContext, string subcategoryResourceName, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs)
301public void LogWarningFromText(BuildEventContext buildEventContext, string subcategoryResourceName, string warningCode, string helpKeyword, BuildEventFileInfo file, string message)
327if (buildEvent.ProjectFile == null && buildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId)
404public BuildEventContext CreateEvaluationBuildEventContext(int nodeId, int submissionId)
405=> new BuildEventContext(submissionId, nodeId, NextEvaluationId, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
408public BuildEventContext CreateProjectCacheBuildEventContext(
423return new BuildEventContext(submissionId, nodeId, evaluationId, projectInstanceId, projectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
427public void LogProjectEvaluationStarted(BuildEventContext projectEvaluationEventContext, string projectFile)
451BuildEventContext projectEvaluationEventContext,
489public BuildEventContext LogProjectStarted(
490BuildEventContext nodeBuildEventContext,
493BuildEventContext parentBuildEventContext,
498int evaluationId = BuildEventContext.InvalidEvaluationId,
499int projectContextId = BuildEventContext.InvalidProjectContextId)
523BuildEventContext nodeBuildEventContext,
526BuildEventContext parentBuildEventContext,
531int evaluationId = BuildEventContext.InvalidEvaluationId,
532int projectContextId = BuildEventContext.InvalidProjectContextId)
536if (projectContextId == BuildEventContext.InvalidProjectContextId)
572BuildEventContext projectBuildEventContext = new BuildEventContext(submissionId, nodeBuildEventContext.NodeId, evaluationId, configurationId, projectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
606public void LogProjectFinished(BuildEventContext projectBuildEventContext, string projectFile, bool success)
636public BuildEventContext LogTargetStarted(BuildEventContext projectBuildEventContext, string targetName, string projectFile, string projectFileOfTargetElement, string parentTargetName, TargetBuiltReason buildReason)
639BuildEventContext targetBuildEventContext = new BuildEventContext(
645BuildEventContext.InvalidTaskId);
675public void LogTargetFinished(BuildEventContext targetBuildEventContext, string targetName, string projectFile, string projectFileOfTargetElement, bool success, IEnumerable<TaskItem> targetOutputs)
704public void LogTaskStarted(BuildEventContext taskBuildEventContext, string taskName, string projectFile, string projectFileOfTaskNode, string taskAssemblyLocation)
733public BuildEventContext LogTaskStarted2(BuildEventContext targetBuildEventContext, string taskName, string projectFile, string projectFileOfTaskNode, int line, int column, string taskAssemblyLocation)
736BuildEventContext taskBuildEventContext = new BuildEventContext(
771public void LogTaskFinished(BuildEventContext taskBuildEventContext, string taskName, string projectFile, string projectFileOfTaskNode, bool success)
799public void LogTelemetry(BuildEventContext buildEventContext, string eventName, IDictionary<string, string> properties)
821public void LogIncludeFile(BuildEventContext buildEventContext, string filePath)
BackEnd\Components\Scheduler\Scheduler.cs (9)
558BuildEventContext context = new BuildEventContext(submissionId, 0, 0, 0, 0, 0);
2017BuildEventContext NewBuildEventContext()
2022BuildEventContext.InvalidProjectInstanceId,
2023BuildEventContext.InvalidProjectContextId,
2024BuildEventContext.InvalidTargetId,
2025BuildEventContext.InvalidTaskId);
2294private void WriteNodeUtilizationGraph(ILoggingService loggingService, BuildEventContext context, bool useConfigurations)
2428private void WriteNodeUtilizationGraphLine(ILoggingService loggingService, BuildEventContext context, int[] currentWork, int[] previousWork, DateTime currentEventTime, DateTime previousEventTime, int invalidWorkId, ref double accumulatedDuration)
2500private void WriteRecursiveSummary(ILoggingService loggingService, BuildEventContext context, int submissionId, SchedulableRequest request, int level, bool useConfigurations, bool isLastChild)
BackEnd\Components\SdkResolution\SdkResolverRequest.cs (4)
17private BuildEventContext _buildEventContext;
33private SdkResolverRequest(int submissionId, string name, string version, string minimumVersion, BuildEventContext buildEventContext, ElementLocation elementLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio)
47public BuildEventContext BuildEventContext => _buildEventContext;
71public static SdkResolverRequest Create(int submissionId, SdkReference sdkReference, BuildEventContext buildEventContext, ElementLocation elementLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio)
BackEnd\Shared\EventsCreatorHelper.cs (3)
16public static BuildMessageEventArgs CreateMessageEventFromText(BuildEventContext buildEventContext, MessageImportance importance, string message, params object?[]? messageArgs)
33public static BuildErrorEventArgs CreateErrorEventFromText(BuildEventContext buildEventContext, string? subcategoryResourceName, string? errorCode, string? helpKeyword, BuildEventFileInfo file, string message)
64public static BuildWarningEventArgs CreateWarningEventFromText(BuildEventContext buildEventContext, string? subcategoryResourceName, string? errorCode, string? helpKeyword, BuildEventFileInfo file, string message)
Evaluation\Evaluator.cs (5)
214BuildEventContext buildEventContext)
309BuildEventContext buildEventContext,
363internal static List<I> CreateItemsFromInclude(string rootDirectory, ProjectItemElement itemElement, IItemFactory<I, I> itemFactory, string unevaluatedIncludeEscaped, Expander<P, I> expander, ILoggingService loggingService, string buildEventFileInfoFullPath, BuildEventContext buildEventContext)
619ErrorUtilities.VerifyThrow(_data.EvaluationId == BuildEventContext.InvalidEvaluationId, "There is no prior evaluation ID. The evaluator data needs to be reset at this point");
647ErrorUtilities.VerifyThrow(_data.EvaluationId != BuildEventContext.InvalidEvaluationId, "Evaluation should produce an evaluation ID");
Instance\ProjectInstance.cs (29)
188private int _evaluationId = BuildEventContext.InvalidEvaluationId;
309BuildEventContext buildEventContext = new BuildEventContext(buildParameters.NodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId);
515BuildEventContext buildEventContext = new BuildEventContext(0, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId);
589BuildEventContext buildEventContext = new BuildEventContext(0, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId);
604BuildEventContext buildEventContext = new BuildEventContext(submissionId, 0, BuildEventContext.InvalidProjectInstanceId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidTaskId);
613internal ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, int submissionId, ProjectLoadSettings? projectLoadSettings)
629internal ProjectInstance(ProjectRootElement xml, IDictionary<string, string> globalProperties, string toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, int submissionId)
2534BuildEventContext projectBuildEventContext,
2596BuildEventContext projectBuildEventContext,
2879BuildEventContext projectBuildEventContext,
2933BuildEventContext projectBuildEventContext,
3077BuildEventContext buildEventContext,
3079int submissionId = BuildEventContext.InvalidSubmissionId,
3167ErrorUtilities.VerifyThrow(EvaluationId == BuildEventContext.InvalidEvaluationId, "Evaluation ID is invalid prior to evaluation");
3189ErrorUtilities.VerifyThrow(EvaluationId != BuildEventContext.InvalidEvaluationId, "Evaluation should produce an evaluation ID");
3458public GenericLoggingContext(ILoggingService loggingService, BuildEventContext eventContext)
Logging\ParallelLogger\ParallelConsoleLogger.cs (27)
68_deferredMessages = new Dictionary<BuildEventContext, List<BuildMessageEventArgs>>(s_compareContextNodeId);
177private void ShownBuildEventContext(BuildEventContext e)
209_deferredMessages = new Dictionary<BuildEventContext, List<BuildMessageEventArgs>>(s_compareContextNodeId);
462BuildEventContext previousEntryPoint = null;
642private (int, int) GetEvaluationKey(BuildEventContext buildEventContext)
1156&& e.BuildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId
1221private void DisplayDeferredStartedEvents(BuildEventContext e)
1269if (e.BuildEventContext.TaskId != BuildEventContext.InvalidTaskId && e.File == null)
1282if ((IsVerbosityAtLeast(LoggerVerbosity.Diagnostic) || _showEventId) && e.BuildEventContext.TaskId != BuildEventContext.InvalidTaskId)
1312BuildEventContext currentBuildEventContext = e.BuildEventContext;
1361private bool WriteTargetMessagePrefix(BuildEventArgs e, BuildEventContext context, DateTime timeStamp)
1423private void DisplayDeferredTargetStartedEvent(BuildEventContext e)
1498private void DisplayDeferredProjectStartedEvent(BuildEventContext e)
1596private void WriteLinePrefix(BuildEventContext e, DateTime eventTimeStamp, bool isMessagePrefix)
1640private ProjectFullKey GetFullProjectKey(BuildEventContext e)
1694private Dictionary<BuildEventContext, object> _startedEvent;
1707internal void AddEventStarted(string projectTargetNames, BuildEventContext buildEventContext, DateTime eventTimeStamp, IEqualityComparer<BuildEventContext> comparer)
1721? new Dictionary<BuildEventContext, object>()
1722: new Dictionary<BuildEventContext, object>(comparer);
1734internal void AddEventFinished(string projectTargetNames, BuildEventContext buildEventContext, DateTime eventTimeStamp)
1784private static readonly ComparerContextNodeId<BuildEventContext> s_compareContextNodeId = new ComparerContextNodeId<BuildEventContext>();
1785private static readonly ComparerContextNodeIdTargetId<BuildEventContext> s_compareContextNodeIdTargetId = new ComparerContextNodeIdTargetId<BuildEventContext>();
1786private BuildEventContext _lastDisplayedBuildEventContext;
1799private Dictionary<BuildEventContext, List<BuildMessageEventArgs>> _deferredMessages;