From e4f6f42400b12aa0cbf5fe10e1b1895742e3f8e5 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 20 Jan 2019 14:46:36 -0500 Subject: [PATCH] Adds more logging --- src/git/gitService.ts | 10 +++++++--- src/git/gitUri.ts | 6 +++++- src/views/nodes/fileHistoryTrackerNode.ts | 16 +++++++++++++++- src/views/nodes/lineHistoryTrackerNode.ts | 12 ++++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/git/gitService.ts b/src/git/gitService.ts index af5df93..4e726e2 100644 --- a/src/git/gitService.ts +++ b/src/git/gitService.ts @@ -1679,7 +1679,9 @@ export class GitService implements Disposable { async getRepoPath(filePath: string, options?: { ref?: string }): Promise; async getRepoPath(uri: Uri | undefined, options?: { ref?: string }): Promise; - @log() + @log({ + exit: path => `returned ${path}` + }) async getRepoPath( filePathOrUri: string | Uri | undefined, options: { ref?: string } = {} @@ -1795,7 +1797,9 @@ export class GitService implements Disposable { repoPathOrUri: string | Uri, options?: { ref?: string; skipCacheUpdate?: boolean } ): Promise; - @log() + @log({ + exit: repo => `returned ${repo !== undefined ? `${repo.path}` : 'undefined'}` + }) async getRepository( repoPathOrUri: string | Uri, options: { ref?: string; skipCacheUpdate?: boolean } = {} @@ -1985,7 +1989,7 @@ export class GitService implements Disposable { ): Promise; async isTracked(uri: GitUri): Promise; @log({ - exit: tracked => tracked.toString(), + exit: tracked => `returned ${tracked.toString()}`, singleLine: true }) async isTracked( diff --git a/src/git/gitUri.ts b/src/git/gitUri.ts index 09589fd..45c788a 100644 --- a/src/git/gitUri.ts +++ b/src/git/gitUri.ts @@ -5,7 +5,8 @@ import { UriComparer } from '../comparers'; import { DocumentSchemes, GlyphChars } from '../constants'; import { Container } from '../container'; import { GitCommit, GitFile, GitService } from '../git/gitService'; -import { Strings } from '../system'; +import { Logger } from '../logger'; +import { debug, Strings } from '../system'; const empty = ''; const slash = '/'; @@ -231,6 +232,9 @@ export class GitUri extends ((Uri as any) as UriEx) { return new GitUri(uri); } + @debug({ + exit: uri => `returned ${Logger.toLoggable(uri)}` + }) static async fromUri(uri: Uri) { if (uri instanceof GitUri) return uri; diff --git a/src/views/nodes/fileHistoryTrackerNode.ts b/src/views/nodes/fileHistoryTrackerNode.ts index 2e7611e..f78c3be 100644 --- a/src/views/nodes/fileHistoryTrackerNode.ts +++ b/src/views/nodes/fileHistoryTrackerNode.ts @@ -4,6 +4,7 @@ import { UriComparer } from '../../comparers'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; import { GitCommitish, GitUri } from '../../git/gitService'; +import { Logger } from '../../logger'; import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../../quickpicks'; import { debug, Functions, gate, log } from '../../system'; import { FileHistoryView } from '../fileHistoryView'; @@ -83,8 +84,12 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode `returned ${r}` + }) async refresh(reset: boolean = false) { + const cc = Logger.getCorrelationContext(); + if (reset) { this._uri = unknownGitUri; this.resetChild(); @@ -103,10 +108,16 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode