Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved logging in project manager #2203

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/OmniSharp.MSBuild/ProjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -744,7 +744,7 @@ private void UpdateProjectReferences(Project project, ImmutableArray<string> 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);
Expand Down Expand Up @@ -807,13 +807,13 @@ private void UpdateReferences(Project project, ImmutableArray<string> 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);
Expand Down