@@ -7,6 +7,7 @@ import * as vscode from 'vscode';
7
7
import { load } from 'js-yaml' ;
8
8
import { CacheHelper } from './common/cache' ;
9
9
import { Disposable , disposeAll } from './common/dispose' ;
10
+ import Log from './common/logger' ;
10
11
11
12
export class ReleaseNotes extends Disposable {
12
13
public static readonly viewType = 'gitpodReleaseNotes' ;
@@ -20,14 +21,20 @@ export class ReleaseNotes extends Disposable {
20
21
21
22
constructor (
22
23
private readonly context : vscode . ExtensionContext ,
24
+ private readonly logger : Log ,
23
25
) {
24
26
super ( ) ;
25
27
26
28
this . lastReadId = this . context . globalState . get < string > ( ReleaseNotes . RELEASE_NOTES_LAST_READ_KEY ) ;
27
29
28
30
this . _register ( vscode . commands . registerCommand ( 'gitpod.showReleaseNotes' , ( ) => this . createOrShow ( ) ) ) ;
29
31
30
- this . showIfNewRelease ( this . lastReadId ) ;
32
+ const releaseNotesEnabled = vscode . workspace . getConfiguration ( 'gitpod' ) . get < boolean > ( 'showReleaseNotes' ) ;
33
+ if ( releaseNotesEnabled ) {
34
+ this . showIfNewRelease ( this . lastReadId ) ;
35
+ } else {
36
+ logger . info ( 'Release notes are disabled' ) ;
37
+ }
31
38
}
32
39
33
40
private async getLastPublish ( ) {
@@ -158,14 +165,12 @@ export class ReleaseNotes extends Disposable {
158
165
}
159
166
160
167
private async showIfNewRelease ( lastReadId : string | undefined ) {
161
- const showReleaseNotes = vscode . workspace . getConfiguration ( 'gitpod' ) . get < boolean > ( 'showReleaseNotes' ) ;
162
- if ( showReleaseNotes ) {
168
+ this . logger . info ( `Last read release notes: ${ lastReadId } ` ) ;
163
169
const releaseId = await this . getLastPublish ( ) ;
164
170
if ( releaseId && releaseId !== lastReadId ) {
165
- console . log ( `gitpod release notes lastReadId: ${ lastReadId } , latestReleaseId: ${ releaseId } ` ) ;
171
+ this . logger . info ( `gitpod release notes lastReadId: ${ lastReadId } , latestReleaseId: ${ releaseId } ` ) ;
166
172
this . createOrShow ( ) ;
167
173
}
168
- }
169
174
}
170
175
171
176
public createOrShow ( ) {
0 commit comments