@codingame/monaco-vscode-log-service-override 4.5.0 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -2
- package/log.js +2 -2
- package/override/vs/workbench/browser/web.main.js +6 -0
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/logs/common/logs.contribution.js +28 -40
- package/vscode/src/vs/workbench/contrib/logs/common/logsActions.js +78 -108
- package/log.d.ts +0 -14
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
1
|
+
export * from 'vscode/service-override/log';
|
|
2
|
+
export { default } from 'vscode/service-override/log';
|
package/log.js
CHANGED
|
@@ -7,7 +7,6 @@ import { ILoggerService, ILogService } from 'vscode/vscode/vs/platform/log/commo
|
|
|
7
7
|
import { FileLoggerService } from './vscode/src/vs/platform/log/common/fileLog.js';
|
|
8
8
|
import { LogService } from 'vscode/vscode/vs/platform/log/common/logService';
|
|
9
9
|
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
10
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
11
10
|
import { windowLogId } from 'vscode/vscode/vs/workbench/services/log/common/logConstants';
|
|
12
11
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
13
12
|
import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
@@ -16,6 +15,7 @@ import { IDefaultLogLevelsService } from 'vscode/vscode/vs/workbench/contrib/log
|
|
|
16
15
|
import getServiceOverride$1 from '@codingame/monaco-vscode-environment-service-override';
|
|
17
16
|
import { logsPath } from 'vscode/workbench';
|
|
18
17
|
import { checkServicesNotInitialized } from 'vscode/lifecycle';
|
|
18
|
+
import { rendererLogLabel } from './override/vs/workbench/browser/web.main.js';
|
|
19
19
|
import './vscode/src/vs/workbench/contrib/logs/common/logs.contribution.js';
|
|
20
20
|
|
|
21
21
|
let _FileLoggerService = class _FileLoggerService extends FileLoggerService {
|
|
@@ -30,7 +30,7 @@ _FileLoggerService = __decorate([
|
|
|
30
30
|
const otherLoggers = [];
|
|
31
31
|
let _LogService = class _LogService extends LogService {
|
|
32
32
|
constructor(loggerService, environmentService) {
|
|
33
|
-
const logger = loggerService.createLogger(environmentService.logFile, { id: windowLogId, name:
|
|
33
|
+
const logger = loggerService.createLogger(environmentService.logFile, { id: windowLogId, name: rendererLogLabel });
|
|
34
34
|
super(logger, otherLoggers);
|
|
35
35
|
}
|
|
36
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-log-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
30
|
-
"@codingame/monaco-vscode-environment-service-override": "4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2",
|
|
30
|
+
"@codingame/monaco-vscode-environment-service-override": "4.5.2"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -24,6 +24,7 @@ import { CounterSet } from 'vscode/vscode/vs/base/common/map';
|
|
|
24
24
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
25
25
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
26
26
|
|
|
27
|
+
const _moduleId = "vs/workbench/contrib/logs/common/logs.contribution";
|
|
27
28
|
registerAction2(class extends Action2 {
|
|
28
29
|
constructor() {
|
|
29
30
|
super({
|
|
@@ -41,11 +42,7 @@ registerAction2(class extends Action2 {
|
|
|
41
42
|
constructor() {
|
|
42
43
|
super({
|
|
43
44
|
id: 'workbench.action.setDefaultLogLevel',
|
|
44
|
-
title: ( localize2WithPath(
|
|
45
|
-
'vs/workbench/contrib/logs/common/logs.contribution',
|
|
46
|
-
'setDefaultLogLevel',
|
|
47
|
-
"Set Default Log Level"
|
|
48
|
-
)),
|
|
45
|
+
title: ( localize2WithPath(_moduleId, 0, "Set Default Log Level")),
|
|
49
46
|
category: Categories.Developer,
|
|
50
47
|
});
|
|
51
48
|
}
|
|
@@ -61,9 +58,9 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
61
58
|
this.contextKeyService = contextKeyService;
|
|
62
59
|
this.fileService = fileService;
|
|
63
60
|
this.uriIdentityService = uriIdentityService;
|
|
64
|
-
this.contextKeys = ( new CounterSet());
|
|
65
|
-
this.outputChannelRegistry = ( Registry.as(Extensions.OutputChannels));
|
|
66
|
-
this.loggerDisposables = this._register(( new DisposableMap()));
|
|
61
|
+
this.contextKeys = ( (new CounterSet()));
|
|
62
|
+
this.outputChannelRegistry = ( (Registry.as(Extensions.OutputChannels)));
|
|
63
|
+
this.loggerDisposables = this._register(( (new DisposableMap())));
|
|
67
64
|
const contextKey = CONTEXT_LOG_LEVEL.bindTo(contextKeyService);
|
|
68
65
|
contextKey.set(LogLevelToString(loggerService.getLogLevel()));
|
|
69
66
|
loggerService.onDidChangeLogLevel(e => {
|
|
@@ -95,7 +92,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
95
92
|
if (logger.when) {
|
|
96
93
|
const contextKeyExpr = ContextKeyExpr.deserialize(logger.when);
|
|
97
94
|
if (contextKeyExpr) {
|
|
98
|
-
for (const key of ( contextKeyExpr.keys())) {
|
|
95
|
+
for (const key of ( (contextKeyExpr.keys()))) {
|
|
99
96
|
this.contextKeys.add(key);
|
|
100
97
|
}
|
|
101
98
|
if (!this.contextKeyService.contextMatchesRules(contextKeyExpr)) {
|
|
@@ -126,7 +123,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
126
123
|
if (logger.when) {
|
|
127
124
|
const contextKeyExpr = ContextKeyExpr.deserialize(logger.when);
|
|
128
125
|
if (contextKeyExpr) {
|
|
129
|
-
for (const key of ( contextKeyExpr.keys())) {
|
|
126
|
+
for (const key of ( (contextKeyExpr.keys()))) {
|
|
130
127
|
this.contextKeys.delete(key);
|
|
131
128
|
}
|
|
132
129
|
}
|
|
@@ -139,7 +136,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
139
136
|
if (channel && this.uriIdentityService.extUri.isEqual(channel.file, logger.resource)) {
|
|
140
137
|
return;
|
|
141
138
|
}
|
|
142
|
-
const disposables = ( new DisposableStore());
|
|
139
|
+
const disposables = ( (new DisposableStore()));
|
|
143
140
|
const promise = createCancelablePromise(async (token) => {
|
|
144
141
|
await whenProviderRegistered(logger.resource, this.fileService);
|
|
145
142
|
try {
|
|
@@ -151,12 +148,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
151
148
|
}
|
|
152
149
|
const hasToAppendRemote = existingChannel && logger.resource.scheme === Schemas.vscodeRemote;
|
|
153
150
|
const id = hasToAppendRemote ? `${logger.id}.remote` : logger.id;
|
|
154
|
-
const label = hasToAppendRemote ? ( localizeWithPath(
|
|
155
|
-
'vs/workbench/contrib/logs/common/logs.contribution',
|
|
156
|
-
'remote name',
|
|
157
|
-
"{0} (Remote)",
|
|
158
|
-
logger.name ?? logger.id
|
|
159
|
-
)) : logger.name ?? logger.id;
|
|
151
|
+
const label = hasToAppendRemote ? ( localizeWithPath(_moduleId, 1, "{0} (Remote)", logger.name ?? logger.id)) : logger.name ?? logger.id;
|
|
160
152
|
this.outputChannelRegistry.registerChannel({ id, label, file: logger.resource, log: true, extensionId: logger.extensionId });
|
|
161
153
|
disposables.add(toDisposable(() => this.outputChannelRegistry.removeChannel(id)));
|
|
162
154
|
if (remoteLogger) {
|
|
@@ -165,15 +157,15 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
165
157
|
}
|
|
166
158
|
catch (error) {
|
|
167
159
|
if (!isCancellationError(error)) {
|
|
168
|
-
this.logService.error('Error while registering log channel', ( logger.resource.toString()), getErrorMessage(error));
|
|
160
|
+
this.logService.error('Error while registering log channel', ( (logger.resource.toString())), getErrorMessage(error));
|
|
169
161
|
}
|
|
170
162
|
}
|
|
171
163
|
});
|
|
172
164
|
disposables.add(toDisposable(() => promise.cancel()));
|
|
173
|
-
this.loggerDisposables.set(( logger.resource.toString()), disposables);
|
|
165
|
+
this.loggerDisposables.set(( (logger.resource.toString())), disposables);
|
|
174
166
|
}
|
|
175
167
|
deregisterLogChannel(logger) {
|
|
176
|
-
this.loggerDisposables.deleteAndDispose(( logger.resource.toString()));
|
|
168
|
+
this.loggerDisposables.deleteAndDispose(( (logger.resource.toString())));
|
|
177
169
|
}
|
|
178
170
|
async whenFileExists(file, trial, token) {
|
|
179
171
|
const exists = await this.fileService.exists(file);
|
|
@@ -181,12 +173,12 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
181
173
|
return;
|
|
182
174
|
}
|
|
183
175
|
if (token.isCancellationRequested) {
|
|
184
|
-
throw new CancellationError();
|
|
176
|
+
throw ( (new CancellationError()));
|
|
185
177
|
}
|
|
186
178
|
if (trial > 10) {
|
|
187
|
-
throw new Error(`Timed out while waiting for file to be created`);
|
|
179
|
+
throw ( (new Error(`Timed out while waiting for file to be created`)));
|
|
188
180
|
}
|
|
189
|
-
this.logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, ( file.toString()));
|
|
181
|
+
this.logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, ( (file.toString())));
|
|
190
182
|
await timeout(1000, token);
|
|
191
183
|
await this.whenFileExists(file, trial + 1, token);
|
|
192
184
|
}
|
|
@@ -195,11 +187,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
195
187
|
constructor() {
|
|
196
188
|
super({
|
|
197
189
|
id: showWindowLogActionId,
|
|
198
|
-
title: ( localize2WithPath(
|
|
199
|
-
'vs/workbench/contrib/logs/common/logs.contribution',
|
|
200
|
-
'show window log',
|
|
201
|
-
"Show Window Log"
|
|
202
|
-
)),
|
|
190
|
+
title: ( localize2WithPath(_moduleId, 2, "Show Window Log")),
|
|
203
191
|
category: Categories.Developer,
|
|
204
192
|
f1: true
|
|
205
193
|
});
|
|
@@ -211,20 +199,20 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
211
199
|
}));
|
|
212
200
|
}
|
|
213
201
|
};
|
|
214
|
-
LogOutputChannels = ( __decorate([
|
|
215
|
-
( __param(0, ILogService)),
|
|
216
|
-
( __param(1, ILoggerService)),
|
|
217
|
-
( __param(2, IContextKeyService)),
|
|
218
|
-
( __param(3, IFileService)),
|
|
219
|
-
( __param(4, IUriIdentityService))
|
|
220
|
-
], LogOutputChannels));
|
|
202
|
+
LogOutputChannels = ( (__decorate([
|
|
203
|
+
( (__param(0, ILogService))),
|
|
204
|
+
( (__param(1, ILoggerService))),
|
|
205
|
+
( (__param(2, IContextKeyService))),
|
|
206
|
+
( (__param(3, IFileService))),
|
|
207
|
+
( (__param(4, IUriIdentityService)))
|
|
208
|
+
], LogOutputChannels)));
|
|
221
209
|
let LogLevelMigration = class LogLevelMigration {
|
|
222
210
|
constructor(defaultLogLevelsService) {
|
|
223
211
|
defaultLogLevelsService.migrateLogLevels();
|
|
224
212
|
}
|
|
225
213
|
};
|
|
226
|
-
LogLevelMigration = ( __decorate([
|
|
227
|
-
( __param(0, IDefaultLogLevelsService))
|
|
228
|
-
], LogLevelMigration));
|
|
229
|
-
( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(LogOutputChannels, 3 );
|
|
230
|
-
( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(LogLevelMigration, 4 );
|
|
214
|
+
LogLevelMigration = ( (__decorate([
|
|
215
|
+
( (__param(0, IDefaultLogLevelsService)))
|
|
216
|
+
], LogLevelMigration)));
|
|
217
|
+
( (Registry.as(Extensions$1.Workbench))).registerWorkbenchContribution(LogOutputChannels, 3 );
|
|
218
|
+
( (Registry.as(Extensions$1.Workbench))).registerWorkbenchContribution(LogLevelMigration, 4 );
|
|
@@ -15,14 +15,11 @@ import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
|
15
15
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
16
16
|
|
|
17
17
|
var SetLogLevelAction_1;
|
|
18
|
+
const _moduleId = "vs/workbench/contrib/logs/common/logsActions";
|
|
18
19
|
let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
19
20
|
static { SetLogLevelAction_1 = this; }
|
|
20
21
|
static { this.ID = 'workbench.action.setLogLevel'; }
|
|
21
|
-
static { this.TITLE = ( localize2WithPath(
|
|
22
|
-
'vs/workbench/contrib/logs/common/logsActions',
|
|
23
|
-
'setLogLevel',
|
|
24
|
-
"Set Log Level..."
|
|
25
|
-
)); }
|
|
22
|
+
static { this.TITLE = ( localize2WithPath(_moduleId, 0, "Set Log Level...")); }
|
|
26
23
|
constructor(id, label, quickInputService, loggerService, outputService, defaultLogLevelsService) {
|
|
27
24
|
super(id, label);
|
|
28
25
|
this.quickInputService = quickInputService;
|
|
@@ -59,43 +56,37 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
58
|
const entries = [];
|
|
62
|
-
entries.push({ type: 'separator', label: ( localizeWithPath(
|
|
59
|
+
entries.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 1, "All")) });
|
|
63
60
|
entries.push(...this.getLogLevelEntries(defaultLogLevels.default, this.loggerService.getLogLevel(), true));
|
|
64
61
|
if (extensionLogs.length) {
|
|
65
|
-
entries.push({ type: 'separator', label: ( localizeWithPath(
|
|
66
|
-
'vs/workbench/contrib/logs/common/logsActions',
|
|
67
|
-
'extensionLogs',
|
|
68
|
-
"Extension Logs"
|
|
69
|
-
)) });
|
|
62
|
+
entries.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 2, "Extension Logs")) });
|
|
70
63
|
entries.push(...extensionLogs.sort((a, b) => a.label.localeCompare(b.label)));
|
|
71
64
|
}
|
|
72
|
-
entries.push({ type: 'separator', label: ( localizeWithPath(
|
|
65
|
+
entries.push({ type: 'separator', label: ( localizeWithPath(_moduleId, 3, "Logs")) });
|
|
73
66
|
entries.push(...logs.sort((a, b) => a.label.localeCompare(b.label)));
|
|
74
|
-
return (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
quickPick.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
quickPick.show();
|
|
98
|
-
}));
|
|
67
|
+
return (
|
|
68
|
+
(new Promise((resolve, reject) => {
|
|
69
|
+
const disposables = ( (new DisposableStore()));
|
|
70
|
+
const quickPick = this.quickInputService.createQuickPick();
|
|
71
|
+
quickPick.placeholder = ( localizeWithPath(_moduleId, 4, "Set Log Level"));
|
|
72
|
+
quickPick.items = entries;
|
|
73
|
+
let selectedItem;
|
|
74
|
+
disposables.add(quickPick.onDidTriggerItemButton(e => {
|
|
75
|
+
quickPick.hide();
|
|
76
|
+
this.defaultLogLevelsService.setDefaultLogLevel(e.item.level);
|
|
77
|
+
}));
|
|
78
|
+
disposables.add(quickPick.onDidAccept(e => {
|
|
79
|
+
selectedItem = quickPick.selectedItems[0];
|
|
80
|
+
quickPick.hide();
|
|
81
|
+
}));
|
|
82
|
+
disposables.add(quickPick.onDidHide(() => {
|
|
83
|
+
const result = selectedItem ? selectedItem.level ?? selectedItem : null;
|
|
84
|
+
disposables.dispose();
|
|
85
|
+
resolve(result);
|
|
86
|
+
}));
|
|
87
|
+
quickPick.show();
|
|
88
|
+
}))
|
|
89
|
+
);
|
|
99
90
|
}
|
|
100
91
|
static isLevelSettable(channel) {
|
|
101
92
|
return channel.log && channel.file !== undefined && channel.id !== telemetryLogId && channel.id !== extensionTelemetryLogChannelId;
|
|
@@ -105,46 +96,35 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
105
96
|
const defaultLogLevel = defaultLogLevels.extensions.find(e => e[0] === logChannel.extensionId?.toLowerCase())?.[1] ?? defaultLogLevels.default;
|
|
106
97
|
const currentLogLevel = this.loggerService.getLogLevel(logChannel.resource) ?? defaultLogLevel;
|
|
107
98
|
const entries = this.getLogLevelEntries(defaultLogLevel, currentLogLevel, !!logChannel.extensionId);
|
|
108
|
-
return (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.loggerService.setLogLevel(logChannel.resource, selectedItem.level);
|
|
135
|
-
}
|
|
136
|
-
disposables.dispose();
|
|
137
|
-
resolve();
|
|
138
|
-
}));
|
|
139
|
-
quickPick.show();
|
|
140
|
-
}));
|
|
99
|
+
return (
|
|
100
|
+
(new Promise((resolve, reject) => {
|
|
101
|
+
const disposables = ( (new DisposableStore()));
|
|
102
|
+
const quickPick = this.quickInputService.createQuickPick();
|
|
103
|
+
quickPick.placeholder = logChannel ? ( localizeWithPath(_moduleId, 5, " {0}: Select log level", logChannel?.label)) : ( localizeWithPath(_moduleId, 6, "Select log level"));
|
|
104
|
+
quickPick.items = entries;
|
|
105
|
+
quickPick.activeItems = entries.filter((entry) => entry.level === this.loggerService.getLogLevel());
|
|
106
|
+
let selectedItem;
|
|
107
|
+
disposables.add(quickPick.onDidTriggerItemButton(e => {
|
|
108
|
+
quickPick.hide();
|
|
109
|
+
this.defaultLogLevelsService.setDefaultLogLevel(e.item.level, logChannel.extensionId);
|
|
110
|
+
}));
|
|
111
|
+
disposables.add(quickPick.onDidAccept(e => {
|
|
112
|
+
selectedItem = quickPick.selectedItems[0];
|
|
113
|
+
quickPick.hide();
|
|
114
|
+
}));
|
|
115
|
+
disposables.add(quickPick.onDidHide(() => {
|
|
116
|
+
if (selectedItem) {
|
|
117
|
+
this.loggerService.setLogLevel(logChannel.resource, selectedItem.level);
|
|
118
|
+
}
|
|
119
|
+
disposables.dispose();
|
|
120
|
+
resolve();
|
|
121
|
+
}));
|
|
122
|
+
quickPick.show();
|
|
123
|
+
}))
|
|
124
|
+
);
|
|
141
125
|
}
|
|
142
126
|
getLogLevelEntries(defaultLogLevel, currentLogLevel, canSetDefaultLogLevel) {
|
|
143
|
-
const button = canSetDefaultLogLevel ? { iconClass: ThemeIcon.asClassName(Codicon.checkAll), tooltip: ( localizeWithPath(
|
|
144
|
-
'vs/workbench/contrib/logs/common/logsActions',
|
|
145
|
-
'resetLogLevel',
|
|
146
|
-
"Set as Default Log Level"
|
|
147
|
-
)) } : undefined;
|
|
127
|
+
const button = canSetDefaultLogLevel ? { iconClass: ThemeIcon.asClassName(Codicon.checkAll), tooltip: ( localizeWithPath(_moduleId, 7, "Set as Default Log Level")) } : undefined;
|
|
148
128
|
return [
|
|
149
129
|
{ label: this.getLabel(LogLevel.Trace, currentLogLevel), level: LogLevel.Trace, description: this.getDescription(LogLevel.Trace, defaultLogLevel), buttons: button && defaultLogLevel !== LogLevel.Trace ? [button] : undefined },
|
|
150
130
|
{ label: this.getLabel(LogLevel.Debug, currentLogLevel), level: LogLevel.Debug, description: this.getDescription(LogLevel.Debug, defaultLogLevel), buttons: button && defaultLogLevel !== LogLevel.Debug ? [button] : undefined },
|
|
@@ -159,22 +139,18 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
159
139
|
return level === current ? `$(check) ${label}` : label;
|
|
160
140
|
}
|
|
161
141
|
getDescription(level, defaultLogLevel) {
|
|
162
|
-
return defaultLogLevel === level ? ( localizeWithPath(
|
|
142
|
+
return defaultLogLevel === level ? ( localizeWithPath(_moduleId, 8, "Default")) : undefined;
|
|
163
143
|
}
|
|
164
144
|
};
|
|
165
|
-
SetLogLevelAction = SetLogLevelAction_1 = ( __decorate([
|
|
166
|
-
( __param(2, IQuickInputService)),
|
|
167
|
-
( __param(3, ILoggerService)),
|
|
168
|
-
( __param(4, IOutputService)),
|
|
169
|
-
( __param(5, IDefaultLogLevelsService))
|
|
170
|
-
], SetLogLevelAction));
|
|
145
|
+
SetLogLevelAction = SetLogLevelAction_1 = ( (__decorate([
|
|
146
|
+
( (__param(2, IQuickInputService))),
|
|
147
|
+
( (__param(3, ILoggerService))),
|
|
148
|
+
( (__param(4, IOutputService))),
|
|
149
|
+
( (__param(5, IDefaultLogLevelsService)))
|
|
150
|
+
], SetLogLevelAction)));
|
|
171
151
|
(class OpenWindowSessionLogFileAction extends Action {
|
|
172
152
|
static { this.ID = 'workbench.action.openSessionLogFile'; }
|
|
173
|
-
static { this.TITLE = ( localize2WithPath(
|
|
174
|
-
'vs/workbench/contrib/logs/common/logsActions',
|
|
175
|
-
'openSessionLogFile',
|
|
176
|
-
"Open Window Log File (Session)..."
|
|
177
|
-
)); }
|
|
153
|
+
static { this.TITLE = ( localize2WithPath(_moduleId, 9, "Open Window Log File (Session)...")); }
|
|
178
154
|
constructor(id, label, environmentService, fileService, quickInputService, editorService) {
|
|
179
155
|
super(id, label);
|
|
180
156
|
this.environmentService = environmentService;
|
|
@@ -183,32 +159,24 @@ SetLogLevelAction = SetLogLevelAction_1 = ( __decorate([
|
|
|
183
159
|
this.editorService = editorService;
|
|
184
160
|
}
|
|
185
161
|
async run() {
|
|
186
|
-
const sessionResult = await this.quickInputService.pick(this.getSessions().then(sessions => ( sessions.map((s, index) => ({
|
|
187
|
-
id: ( s.toString()),
|
|
162
|
+
const sessionResult = await this.quickInputService.pick(this.getSessions().then(sessions => ( (sessions.map((s, index) => ({
|
|
163
|
+
id: ( (s.toString())),
|
|
188
164
|
label: basename(s),
|
|
189
|
-
description: index === 0 ? ( localizeWithPath(
|
|
190
|
-
})))), {
|
|
165
|
+
description: index === 0 ? ( localizeWithPath(_moduleId, 10, "Current")) : undefined
|
|
166
|
+
}))))), {
|
|
191
167
|
canPickMany: false,
|
|
192
|
-
placeHolder: ( localizeWithPath(
|
|
193
|
-
'vs/workbench/contrib/logs/common/logsActions',
|
|
194
|
-
'sessions placeholder',
|
|
195
|
-
"Select Session"
|
|
196
|
-
))
|
|
168
|
+
placeHolder: ( localizeWithPath(_moduleId, 11, "Select Session"))
|
|
197
169
|
});
|
|
198
170
|
if (sessionResult) {
|
|
199
|
-
const logFileResult = await this.quickInputService.pick(this.getLogFiles(( URI.parse(sessionResult.id))).then(logFiles => ( logFiles.map(s => ({
|
|
200
|
-
id: ( s.toString()),
|
|
171
|
+
const logFileResult = await this.quickInputService.pick(this.getLogFiles(( (URI.parse(sessionResult.id)))).then(logFiles => ( (logFiles.map(s => ({
|
|
172
|
+
id: ( (s.toString())),
|
|
201
173
|
label: basename(s)
|
|
202
|
-
})))), {
|
|
174
|
+
}))))), {
|
|
203
175
|
canPickMany: false,
|
|
204
|
-
placeHolder: ( localizeWithPath(
|
|
205
|
-
'vs/workbench/contrib/logs/common/logsActions',
|
|
206
|
-
'log placeholder',
|
|
207
|
-
"Select Log file"
|
|
208
|
-
))
|
|
176
|
+
placeHolder: ( localizeWithPath(_moduleId, 12, "Select Log file"))
|
|
209
177
|
});
|
|
210
178
|
if (logFileResult) {
|
|
211
|
-
return this.editorService.openEditor({ resource: ( URI.parse(logFileResult.id)), options: { pinned: true } }).then(() => undefined);
|
|
179
|
+
return this.editorService.openEditor({ resource: ( (URI.parse(logFileResult.id))), options: { pinned: true } }).then(() => undefined);
|
|
212
180
|
}
|
|
213
181
|
}
|
|
214
182
|
}
|
|
@@ -217,18 +185,20 @@ SetLogLevelAction = SetLogLevelAction_1 = ( __decorate([
|
|
|
217
185
|
const result = [logsPath];
|
|
218
186
|
const stat = await this.fileService.resolve(dirname(logsPath));
|
|
219
187
|
if (stat.children) {
|
|
220
|
-
result.push(...( stat.children
|
|
188
|
+
result.push(...( (stat.children
|
|
221
189
|
.filter(stat => !isEqual(stat.resource, logsPath) && stat.isDirectory && /^\d{8}T\d{6}$/.test(stat.name))
|
|
222
190
|
.sort()
|
|
223
191
|
.reverse()
|
|
224
|
-
.map(d => d.resource)));
|
|
192
|
+
.map(d => d.resource))));
|
|
225
193
|
}
|
|
226
194
|
return result;
|
|
227
195
|
}
|
|
228
196
|
async getLogFiles(session) {
|
|
229
197
|
const stat = await this.fileService.resolve(session);
|
|
230
198
|
if (stat.children) {
|
|
231
|
-
return (
|
|
199
|
+
return (
|
|
200
|
+
(stat.children.filter(stat => !stat.isDirectory).map(stat => stat.resource))
|
|
201
|
+
);
|
|
232
202
|
}
|
|
233
203
|
return [];
|
|
234
204
|
}
|
package/log.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IEditorOverrideServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
2
|
-
import { LogLevel, ILogger } from 'vscode/vscode/vs/platform/log/common/log';
|
|
3
|
-
export { ConsoleLogger, ILogger } from 'vscode/vscode/vs/platform/log/common/log';
|
|
4
|
-
import { IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
|
|
6
|
-
declare function getServiceOverride(): IEditorOverrideServices;
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Provide logLevel via the services `initialize` function `configuration.developmentOptions.logLevel` parameter
|
|
9
|
-
*/
|
|
10
|
-
declare function getServiceOverride(logLevel?: LogLevel): IEditorOverrideServices;
|
|
11
|
-
|
|
12
|
-
declare function registerAdditionalLogger(logger: ILogger): IDisposable;
|
|
13
|
-
|
|
14
|
-
export { getServiceOverride as default, registerAdditionalLogger };
|