From bc5aee4cdf8cc8b981a3acf2cdc050b409a9b2ba Mon Sep 17 00:00:00 2001 From: Filip W Date: Mon, 2 Aug 2021 15:58:03 +0200 Subject: [PATCH] Improved logging in project manager --- src/OmniSharp.MSBuild/ProjectManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OmniSharp.MSBuild/ProjectManager.cs b/src/OmniSharp.MSBuild/ProjectManager.cs index e72da753c6..2bf70ca9b1 100644 --- a/src/OmniSharp.MSBuild/ProjectManager.cs +++ b/src/OmniSharp.MSBuild/ProjectManager.cs @@ -185,7 +185,7 @@ private async Task ProcessLoopAsync(CancellationToken cancellationToken) } catch (Exception ex) { - _logger.LogError($"Error occurred while processing project updates: {ex}"); + _logger.LogError(ex, "Error occurred while processing project updates"); } } } @@ -329,7 +329,7 @@ private void ProcessQueue(CancellationToken cancellationToken) } catch (Exception ex) { - _logger.LogWarning($"Failed to load project file '{projectFilePath}'.", ex); + _logger.LogError(ex, "Failed to load project file '{projectFilePath}'."); _eventEmitter.Error(ex, fileName: projectFilePath); return (null, null); } @@ -744,7 +744,7 @@ private void UpdateProjectReferences(Project project, ImmutableArray pro } else { - _logger.LogDebug($"failed to get project info:{project.FilePath}"); + _logger.LogWarning($"Failed to get project info: {project.FilePath}"); } var projectReference = new ProjectReference(referencedProject.Id, aliases); @@ -807,13 +807,13 @@ private void UpdateReferences(Project project, ImmutableArray projectRef if (!string.IsNullOrEmpty(aliases)) { reference = reference.WithAliases(aliases.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries).Select(a => a.Trim())); - _logger.LogDebug($"setting aliases: {referencePath}, {aliases} "); + _logger.LogDebug($"Setting aliases: {referencePath}, {aliases} "); } } } else { - _logger.LogDebug($"failed to get project info:{project.FilePath}"); + _logger.LogDebug($"Failed to get project info: {project.FilePath}"); } _logger.LogDebug($"Adding reference '{referencePath}' to '{project.Name}'."); _workspace.AddMetadataReference(project.Id, reference);