55
66import * as fs from 'fs' ;
77import * as path from 'path' ;
8- import { CancellationToken , Command , Disposable , env , Event , EventEmitter , LogLevel , Memento , OutputChannel , ProgressLocation , ProgressOptions , scm , SourceControl , SourceControlInputBox , SourceControlInputBoxValidation , SourceControlInputBoxValidationType , SourceControlResourceDecorations , SourceControlResourceGroup , SourceControlResourceState , ThemeColor , Uri , window , workspace , WorkspaceEdit , Decoration } from 'vscode' ;
8+ import { CancellationToken , Command , Disposable , Event , EventEmitter , Memento , OutputChannel , ProgressLocation , ProgressOptions , scm , SourceControl , SourceControlInputBox , SourceControlInputBoxValidation , SourceControlInputBoxValidationType , SourceControlResourceDecorations , SourceControlResourceGroup , SourceControlResourceState , ThemeColor , Uri , window , workspace , WorkspaceEdit , Decoration } from 'vscode' ;
99import * as nls from 'vscode-nls' ;
1010import { Branch , Change , GitErrorCodes , LogOptions , Ref , RefType , Remote , Status } from './api/git' ;
1111import { AutoFetcher } from './autofetch' ;
@@ -15,6 +15,7 @@ import { StatusBarCommands } from './statusbar';
1515import { toGitUri } from './uri' ;
1616import { anyEvent , combinedDisposable , debounceEvent , dispose , EmptyDisposable , eventToPromise , filterEvent , find , IDisposable , isDescendant , onceEvent } from './util' ;
1717import { IFileWatcher , watch } from './watch' ;
18+ import { Log , LogLevel } from './log' ;
1819
1920const timeout = ( millis : number ) => new Promise ( c => setTimeout ( c , millis ) ) ;
2021
@@ -457,8 +458,8 @@ class FileEventLogger {
457458 private onDotGitFileChange : Event < Uri > ,
458459 private outputChannel : OutputChannel
459460 ) {
460- this . logLevelDisposable = env . onDidChangeLogLevel ( this . onDidChangeLogLevel , this ) ;
461- this . onDidChangeLogLevel ( env . logLevel ) ;
461+ this . logLevelDisposable = Log . onDidChangeLogLevel ( this . onDidChangeLogLevel , this ) ;
462+ this . onDidChangeLogLevel ( Log . logLevel ) ;
462463 }
463464
464465 private onDidChangeLogLevel ( level : LogLevel ) : void {
@@ -519,7 +520,7 @@ class DotGitWatcher implements IFileWatcher {
519520 this . transientDisposables . push ( upstreamWatcher ) ;
520521 upstreamWatcher . event ( this . emitter . fire , this . emitter , this . transientDisposables ) ;
521522 } catch ( err ) {
522- if ( env . logLevel <= LogLevel . Error ) {
523+ if ( Log . logLevel <= LogLevel . Error ) {
523524 this . outputChannel . appendLine ( `Failed to watch ref '${ upstreamPath } ', is most likely packed.\n${ err . stack || err } ` ) ;
524525 }
525526 }
@@ -682,7 +683,7 @@ export class Repository implements Disposable {
682683 onDotGitFileChange = dotGitFileWatcher . event ;
683684 this . disposables . push ( dotGitFileWatcher ) ;
684685 } catch ( err ) {
685- if ( env . logLevel <= LogLevel . Error ) {
686+ if ( Log . logLevel <= LogLevel . Error ) {
686687 outputChannel . appendLine ( `Failed to watch '${ this . dotGit } ', reverting to legacy API file watched. Some events might be lost.\n${ err . stack || err } ` ) ;
687688 }
688689
0 commit comments