Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit c5f2376

Browse files
committed
Added logging for #1493.
1 parent 8178296 commit c5f2376

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/GitHub.App/Services/TeamExplorerContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void Refresh()
7676

7777
if (newRepositoryPath != repositoryPath)
7878
{
79-
log.Debug("Fire PropertyChanged event for ActiveRepository");
79+
log.Debug("ActiveRepository changed to {CloneUrl} @ {Path}", repo?.CloneUrl, newRepositoryPath);
8080
ActiveRepository = repo;
8181
}
8282
else if (newBranchName != branchName)

src/GitHub.App/ViewModels/GitHubPane/GitHubPaneViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
using GitHub.Extensions;
1212
using GitHub.Factories;
1313
using GitHub.Info;
14+
using GitHub.Logging;
1415
using GitHub.Models;
1516
using GitHub.Primitives;
1617
using GitHub.Services;
1718
using GitHub.VisualStudio;
1819
using ReactiveUI;
20+
using Serilog;
1921
using OleMenuCommand = Microsoft.VisualStudio.Shell.OleMenuCommand;
2022

2123
namespace GitHub.ViewModels.GitHubPane
@@ -27,6 +29,7 @@ namespace GitHub.ViewModels.GitHubPane
2729
[PartCreationPolicy(CreationPolicy.NonShared)]
2830
public sealed class GitHubPaneViewModel : ViewModelBase, IGitHubPaneViewModel, IDisposable
2931
{
32+
static readonly ILogger log = LogManager.ForContext<GitHubPaneViewModel>();
3033
static readonly Regex pullUri = CreateRoute("/:owner/:repo/pull/:number");
3134

3235
readonly IViewViewModelFactory viewModelFactory;
@@ -360,18 +363,22 @@ async Task NavigateTo<TViewModel>(Func<TViewModel, Task> initialize, Func<TViewM
360363

361364
async Task UpdateContent(ILocalRepositoryModel repository)
362365
{
366+
log.Debug("UpdateContent called with {CloneUrl}", repository?.CloneUrl);
367+
363368
LocalRepository = repository;
364369
Connection = null;
365370
Content = null;
366371
navigator.Clear();
367372

368373
if (repository == null)
369374
{
375+
log.Debug("Not a git repository: {CloneUrl}", repository?.CloneUrl);
370376
Content = notAGitRepository;
371377
return;
372378
}
373379
else if (string.IsNullOrWhiteSpace(repository.CloneUrl))
374380
{
381+
log.Debug("Not a GitHub repository: {CloneUrl}", repository?.CloneUrl);
375382
Content = notAGitHubRepository;
376383
return;
377384
}
@@ -389,16 +396,19 @@ async Task UpdateContent(ILocalRepositoryModel repository)
389396

390397
if (Connection?.IsLoggedIn == true)
391398
{
399+
log.Debug("Found a GitHub repository: {CloneUrl}", repository?.CloneUrl);
392400
Content = navigator;
393401
await ShowDefaultPage();
394402
}
395403
else
396404
{
405+
log.Debug("Found a a GitHub repository but not logged in: {CloneUrl}", repository?.CloneUrl);
397406
Content = loggedOut;
398407
}
399408
}
400409
else
401410
{
411+
log.Debug("Not a GitHub repository: {CloneUrl}", repository?.CloneUrl);
402412
Content = notAGitHubRepository;
403413
}
404414
}

src/GitHub.TeamFoundation.14/Services/VSGitExt.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ void RefreshActiveRepositories()
9898
{
9999
try
100100
{
101+
log.Debug(
102+
"IGitExt.ActiveRepositories (#{Id}) returned {Repositories}",
103+
gitService.GetHashCode(),
104+
gitService?.ActiveRepositories.Select(x => x.RepositoryPath));
105+
101106
ActiveRepositories = gitService?.ActiveRepositories.Select(x => repositoryFactory.Create(x.RepositoryPath)).ToList();
102107
}
103108
catch (Exception e)
@@ -118,6 +123,7 @@ private set
118123
{
119124
if (value != activeRepositories)
120125
{
126+
log.Debug("ActiveRepositories changed to {Repositories}", value.Select(x => x.CloneUrl));
121127
activeRepositories = value;
122128
ActiveRepositoriesChanged?.Invoke();
123129
}

0 commit comments

Comments
 (0)