@codingame/monaco-vscode-log-service-override 24.3.0 → 25.0.0
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.js +2 -2
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/logs/common/logs.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/logs/common/logsActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/logs/common/logsActions.js +15 -15
- package/vscode/src/vs/workbench/{contrib/logs → services/log}/common/defaultLogLevels.d.ts +7 -4
- package/vscode/src/vs/workbench/{contrib/logs → services/log}/common/defaultLogLevels.js +38 -19
package/index.js
CHANGED
|
@@ -11,8 +11,8 @@ import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
11
11
|
import { windowLogId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/log/common/logConstants';
|
|
12
12
|
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
13
13
|
import { toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
14
|
-
import { DefaultLogLevelsService } from './vscode/src/vs/workbench/
|
|
15
|
-
import { IDefaultLogLevelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/
|
|
14
|
+
import { DefaultLogLevelsService } from './vscode/src/vs/workbench/services/log/common/defaultLogLevels.js';
|
|
15
|
+
import { IDefaultLogLevelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/log/common/defaultLogLevels.service';
|
|
16
16
|
import getServiceOverride$1 from '@codingame/monaco-vscode-environment-service-override';
|
|
17
17
|
import { logsPath } from '@codingame/monaco-vscode-api/workbench';
|
|
18
18
|
import { checkServicesNotInitialized } from '@codingame/monaco-vscode-api/lifecycle';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-log-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - log service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
19
|
-
"@codingame/monaco-vscode-environment-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "25.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-environment-service-override": "25.0.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -15,12 +15,12 @@ import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
15
15
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
16
16
|
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
17
17
|
import { showWindowLogActionId, windowLogId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/log/common/logConstants';
|
|
18
|
-
import { IDefaultLogLevelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/logs/common/defaultLogLevels.service';
|
|
19
18
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
20
19
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
21
20
|
import { CounterSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
22
21
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
23
22
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
23
|
+
import { IDefaultLogLevelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/log/common/defaultLogLevels.service';
|
|
24
24
|
|
|
25
25
|
registerAction2(class extends Action2 {
|
|
26
26
|
constructor() {
|
|
@@ -40,7 +40,7 @@ registerAction2(class extends Action2 {
|
|
|
40
40
|
constructor() {
|
|
41
41
|
super({
|
|
42
42
|
id: 'workbench.action.setDefaultLogLevel',
|
|
43
|
-
title: ( localize2(
|
|
43
|
+
title: ( localize2(8586, "Set Default Log Level")),
|
|
44
44
|
category: Categories.Developer,
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -142,7 +142,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
142
142
|
}
|
|
143
143
|
const hasToAppendRemote = existingChannel && logger.resource.scheme === Schemas.vscodeRemote;
|
|
144
144
|
const id = hasToAppendRemote ? `${logger.id}.remote` : logger.id;
|
|
145
|
-
const label = hasToAppendRemote ? ( localize(
|
|
145
|
+
const label = hasToAppendRemote ? ( localize(8587, "{0} (Remote)", logger.name ?? logger.id)) : logger.name ?? logger.id;
|
|
146
146
|
this.outputChannelRegistry.registerChannel({ id, label, source: { resource: logger.resource }, log: true, extensionId: logger.extensionId });
|
|
147
147
|
}
|
|
148
148
|
registerCompoundLogChannel(id, name, logger) {
|
|
@@ -175,7 +175,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
|
|
|
175
175
|
constructor() {
|
|
176
176
|
super({
|
|
177
177
|
id: showWindowLogActionId,
|
|
178
|
-
title: ( localize2(
|
|
178
|
+
title: ( localize2(8588, "Show Window Log")),
|
|
179
179
|
category: Categories.Developer,
|
|
180
180
|
f1: true
|
|
181
181
|
});
|
|
@@ -6,7 +6,7 @@ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/fi
|
|
|
6
6
|
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
7
7
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
8
8
|
import { IOutputService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output.service";
|
|
9
|
-
import { IDefaultLogLevelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/
|
|
9
|
+
import { IDefaultLogLevelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/log/common/defaultLogLevels.service";
|
|
10
10
|
export declare class SetLogLevelAction extends Action {
|
|
11
11
|
private readonly quickInputService;
|
|
12
12
|
private readonly loggerService;
|
|
@@ -10,14 +10,14 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/ins
|
|
|
10
10
|
import { basename, dirname, isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
11
11
|
import { isSingleSourceOutputChannelDescriptor, isMultiSourceOutputChannelDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output';
|
|
12
12
|
import { IOutputService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output.service';
|
|
13
|
-
import { IDefaultLogLevelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/logs/common/defaultLogLevels.service';
|
|
14
13
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
15
14
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
16
15
|
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
16
|
+
import { IDefaultLogLevelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/log/common/defaultLogLevels.service';
|
|
17
17
|
|
|
18
18
|
let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
19
19
|
static { this.ID = 'workbench.action.setLogLevel'; }
|
|
20
|
-
static { this.TITLE = ( localize2(
|
|
20
|
+
static { this.TITLE = ( localize2(8589, "Set Log Level...")); }
|
|
21
21
|
constructor(id, label, quickInputService, loggerService, outputService, defaultLogLevelsService) {
|
|
22
22
|
super(id, label);
|
|
23
23
|
this.quickInputService = quickInputService;
|
|
@@ -37,7 +37,7 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
async selectLogLevelOrChannel() {
|
|
40
|
-
const defaultLogLevels =
|
|
40
|
+
const defaultLogLevels = this.defaultLogLevelsService.defaultLogLevels;
|
|
41
41
|
const extensionLogs = [], logs = [];
|
|
42
42
|
const logLevel = this.loggerService.getLogLevel();
|
|
43
43
|
for (const channel of this.outputService.getChannelDescriptors()) {
|
|
@@ -63,18 +63,18 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
const entries = [];
|
|
66
|
-
entries.push({ type: 'separator', label: ( localize(
|
|
66
|
+
entries.push({ type: 'separator', label: ( localize(8590, "All")) });
|
|
67
67
|
entries.push(...this.getLogLevelEntries(defaultLogLevels.default, this.loggerService.getLogLevel(), true));
|
|
68
68
|
if (extensionLogs.length) {
|
|
69
|
-
entries.push({ type: 'separator', label: ( localize(
|
|
69
|
+
entries.push({ type: 'separator', label: ( localize(8591, "Extension Logs")) });
|
|
70
70
|
entries.push(...extensionLogs.sort((a, b) => a.label.localeCompare(b.label)));
|
|
71
71
|
}
|
|
72
|
-
entries.push({ type: 'separator', label: ( localize(
|
|
72
|
+
entries.push({ type: 'separator', label: ( localize(8592, "Logs")) });
|
|
73
73
|
entries.push(...logs.sort((a, b) => a.label.localeCompare(b.label)));
|
|
74
74
|
return (new Promise((resolve, reject) => {
|
|
75
75
|
const disposables = ( new DisposableStore());
|
|
76
76
|
const quickPick = disposables.add(this.quickInputService.createQuickPick({ useSeparators: true }));
|
|
77
|
-
quickPick.placeholder = ( localize(
|
|
77
|
+
quickPick.placeholder = ( localize(8593, "Set Log Level"));
|
|
78
78
|
quickPick.items = entries;
|
|
79
79
|
let selectedItem;
|
|
80
80
|
disposables.add(quickPick.onDidTriggerItemButton(e => {
|
|
@@ -94,13 +94,13 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
94
94
|
}));
|
|
95
95
|
}
|
|
96
96
|
async setLogLevelForChannel(logChannel) {
|
|
97
|
-
const defaultLogLevels =
|
|
97
|
+
const defaultLogLevels = this.defaultLogLevelsService.defaultLogLevels;
|
|
98
98
|
const defaultLogLevel = defaultLogLevels.extensions.find(e => e[0] === logChannel.channel.extensionId?.toLowerCase())?.[1] ?? defaultLogLevels.default;
|
|
99
99
|
const entries = this.getLogLevelEntries(defaultLogLevel, this.outputService.getLogLevel(logChannel.channel) ?? defaultLogLevel, !!logChannel.channel.extensionId);
|
|
100
100
|
return (new Promise((resolve, reject) => {
|
|
101
101
|
const disposables = ( new DisposableStore());
|
|
102
102
|
const quickPick = disposables.add(this.quickInputService.createQuickPick());
|
|
103
|
-
quickPick.placeholder = logChannel ? ( localize(
|
|
103
|
+
quickPick.placeholder = logChannel ? ( localize(8594, " {0}: Select log level", logChannel?.label)) : ( localize(8595, "Select log level"));
|
|
104
104
|
quickPick.items = entries;
|
|
105
105
|
quickPick.activeItems = entries.filter((entry) => entry.level === this.loggerService.getLogLevel());
|
|
106
106
|
let selectedItem;
|
|
@@ -123,7 +123,7 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
123
123
|
}));
|
|
124
124
|
}
|
|
125
125
|
getLogLevelEntries(defaultLogLevel, currentLogLevel, canSetDefaultLogLevel) {
|
|
126
|
-
const button = canSetDefaultLogLevel ? { iconClass: ThemeIcon.asClassName(Codicon.checkAll), tooltip: ( localize(
|
|
126
|
+
const button = canSetDefaultLogLevel ? { iconClass: ThemeIcon.asClassName(Codicon.checkAll), tooltip: ( localize(8596, "Set as Default Log Level")) } : undefined;
|
|
127
127
|
return [
|
|
128
128
|
{ label: this.getLabel(LogLevel.Trace, currentLogLevel), level: LogLevel.Trace, description: this.getDescription(LogLevel.Trace, defaultLogLevel), buttons: button && defaultLogLevel !== LogLevel.Trace ? [button] : undefined },
|
|
129
129
|
{ label: this.getLabel(LogLevel.Debug, currentLogLevel), level: LogLevel.Debug, description: this.getDescription(LogLevel.Debug, defaultLogLevel), buttons: button && defaultLogLevel !== LogLevel.Debug ? [button] : undefined },
|
|
@@ -138,7 +138,7 @@ let SetLogLevelAction = class SetLogLevelAction extends Action {
|
|
|
138
138
|
return level === current ? `$(check) ${label}` : label;
|
|
139
139
|
}
|
|
140
140
|
getDescription(level, defaultLogLevel) {
|
|
141
|
-
return defaultLogLevel === level ? ( localize(
|
|
141
|
+
return defaultLogLevel === level ? ( localize(8597, "Default")) : undefined;
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
SetLogLevelAction = ( __decorate([
|
|
@@ -149,7 +149,7 @@ SetLogLevelAction = ( __decorate([
|
|
|
149
149
|
], SetLogLevelAction));
|
|
150
150
|
(class OpenWindowSessionLogFileAction extends Action {
|
|
151
151
|
static { this.ID = 'workbench.action.openSessionLogFile'; }
|
|
152
|
-
static { this.TITLE = ( localize2(
|
|
152
|
+
static { this.TITLE = ( localize2(8598, "Open Window Log File (Session)...")); }
|
|
153
153
|
constructor(id, label, environmentService, fileService, quickInputService, editorService) {
|
|
154
154
|
super(id, label);
|
|
155
155
|
this.environmentService = environmentService;
|
|
@@ -161,10 +161,10 @@ SetLogLevelAction = ( __decorate([
|
|
|
161
161
|
const sessionResult = await this.quickInputService.pick(this.getSessions().then(sessions => ( sessions.map((s, index) => ({
|
|
162
162
|
id: ( s.toString()),
|
|
163
163
|
label: basename(s),
|
|
164
|
-
description: index === 0 ? ( localize(
|
|
164
|
+
description: index === 0 ? ( localize(8599, "Current")) : undefined
|
|
165
165
|
})))), {
|
|
166
166
|
canPickMany: false,
|
|
167
|
-
placeHolder: ( localize(
|
|
167
|
+
placeHolder: ( localize(8600, "Select Session"))
|
|
168
168
|
});
|
|
169
169
|
if (sessionResult) {
|
|
170
170
|
const logFileResult = await this.quickInputService.pick(this.getLogFiles(( URI.parse(sessionResult.id))).then(logFiles => ( logFiles.map((s) => ({
|
|
@@ -172,7 +172,7 @@ SetLogLevelAction = ( __decorate([
|
|
|
172
172
|
label: basename(s)
|
|
173
173
|
})))), {
|
|
174
174
|
canPickMany: false,
|
|
175
|
-
placeHolder: ( localize(
|
|
175
|
+
placeHolder: ( localize(8601, "Select Log file"))
|
|
176
176
|
});
|
|
177
177
|
if (logFileResult) {
|
|
178
178
|
return this.editorService.openEditor({ resource: ( URI.parse(logFileResult.id)), options: { pinned: true } }).then(() => undefined);
|
|
@@ -5,7 +5,7 @@ import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscod
|
|
|
5
5
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
6
6
|
import { IJSONEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configuration/common/jsonEditing.service";
|
|
7
7
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
8
|
-
import { IDefaultLogLevelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/
|
|
8
|
+
import { IDefaultLogLevelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/log/common/defaultLogLevels.service";
|
|
9
9
|
interface ParsedArgvLogLevels {
|
|
10
10
|
default?: LogLevel;
|
|
11
11
|
extensions?: [
|
|
@@ -22,10 +22,13 @@ export declare class DefaultLogLevelsService extends Disposable implements IDefa
|
|
|
22
22
|
private readonly loggerService;
|
|
23
23
|
_serviceBrand: undefined;
|
|
24
24
|
private _onDidChangeDefaultLogLevels;
|
|
25
|
-
readonly onDidChangeDefaultLogLevels: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<
|
|
25
|
+
readonly onDidChangeDefaultLogLevels: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<Required<Readonly<ParsedArgvLogLevels>>>;
|
|
26
|
+
private _defaultLogLevels;
|
|
26
27
|
constructor(environmentService: IWorkbenchEnvironmentService, fileService: IFileService, jsonEditingService: IJSONEditingService, logService: ILogService, loggerService: ILoggerService);
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
private onDidChangeArgv;
|
|
29
|
+
get defaultLogLevels(): DefaultLogLevels;
|
|
30
|
+
private updateDefaultLogLevels;
|
|
31
|
+
getDefaultLogLevel(extensionId?: string): LogLevel;
|
|
29
32
|
setDefaultLogLevel(defaultLogLevel: LogLevel, extensionId?: string): Promise<void>;
|
|
30
33
|
private _getDefaultLogLevel;
|
|
31
34
|
private _writeLogLevelsToArgv;
|
|
@@ -12,6 +12,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/ext
|
|
|
12
12
|
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
13
13
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
14
14
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
15
|
+
import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
15
16
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
16
17
|
|
|
17
18
|
let DefaultLogLevelsService = class DefaultLogLevelsService extends Disposable {
|
|
@@ -24,38 +25,56 @@ let DefaultLogLevelsService = class DefaultLogLevelsService extends Disposable {
|
|
|
24
25
|
this.loggerService = loggerService;
|
|
25
26
|
this._onDidChangeDefaultLogLevels = this._register(( new Emitter()));
|
|
26
27
|
this.onDidChangeDefaultLogLevels = this._onDidChangeDefaultLogLevels.event;
|
|
28
|
+
this._defaultLogLevels = {
|
|
29
|
+
default: this._getDefaultLogLevelFromEnv(),
|
|
30
|
+
extensions: this._getExtensionsDefaultLogLevelsFromEnv()
|
|
31
|
+
};
|
|
32
|
+
this._register(this.fileService.onDidFilesChange(e => {
|
|
33
|
+
if (e.contains(this.environmentService.argvResource)) {
|
|
34
|
+
this.onDidChangeArgv();
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
async onDidChangeArgv() {
|
|
39
|
+
const defaultLogLevelsFromArgv = await this._parseLogLevelsFromArgv();
|
|
40
|
+
this.updateDefaultLogLevels(defaultLogLevelsFromArgv);
|
|
27
41
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
get defaultLogLevels() {
|
|
43
|
+
return this._defaultLogLevels;
|
|
44
|
+
}
|
|
45
|
+
updateDefaultLogLevels(defaultLogLevelsFromArgv) {
|
|
46
|
+
const defaultLogLevels = {
|
|
47
|
+
default: defaultLogLevelsFromArgv?.default ?? this._getDefaultLogLevelFromEnv(),
|
|
48
|
+
extensions: defaultLogLevelsFromArgv?.extensions ?? this._getExtensionsDefaultLogLevelsFromEnv()
|
|
33
49
|
};
|
|
50
|
+
if (!equals(this._defaultLogLevels, defaultLogLevels)) {
|
|
51
|
+
this._defaultLogLevels = defaultLogLevels;
|
|
52
|
+
this._onDidChangeDefaultLogLevels.fire(this._defaultLogLevels);
|
|
53
|
+
}
|
|
34
54
|
}
|
|
35
|
-
|
|
36
|
-
const argvLogLevel = (await this._parseLogLevelsFromArgv()) ?? {};
|
|
55
|
+
getDefaultLogLevel(extensionId) {
|
|
37
56
|
if (extensionId) {
|
|
38
57
|
extensionId = extensionId.toLowerCase();
|
|
39
|
-
return this._getDefaultLogLevel(
|
|
58
|
+
return this._getDefaultLogLevel(this._defaultLogLevels, extensionId);
|
|
40
59
|
}
|
|
41
60
|
else {
|
|
42
|
-
return this._getDefaultLogLevel(
|
|
61
|
+
return this._getDefaultLogLevel(this._defaultLogLevels);
|
|
43
62
|
}
|
|
44
63
|
}
|
|
45
64
|
async setDefaultLogLevel(defaultLogLevel, extensionId) {
|
|
46
|
-
const
|
|
65
|
+
const defaultLogLevelsFromArgv = (await this._parseLogLevelsFromArgv()) ?? {};
|
|
47
66
|
if (extensionId) {
|
|
48
67
|
extensionId = extensionId.toLowerCase();
|
|
49
|
-
const currentDefaultLogLevel = this._getDefaultLogLevel(
|
|
50
|
-
|
|
51
|
-
const extension =
|
|
68
|
+
const currentDefaultLogLevel = this._getDefaultLogLevel(defaultLogLevelsFromArgv, extensionId);
|
|
69
|
+
defaultLogLevelsFromArgv.extensions = defaultLogLevelsFromArgv.extensions ?? [];
|
|
70
|
+
const extension = defaultLogLevelsFromArgv.extensions.find(([extension]) => extension === extensionId);
|
|
52
71
|
if (extension) {
|
|
53
72
|
extension[1] = defaultLogLevel;
|
|
54
73
|
}
|
|
55
74
|
else {
|
|
56
|
-
|
|
75
|
+
defaultLogLevelsFromArgv.extensions.push([extensionId, defaultLogLevel]);
|
|
57
76
|
}
|
|
58
|
-
await this._writeLogLevelsToArgv(
|
|
77
|
+
await this._writeLogLevelsToArgv(defaultLogLevelsFromArgv);
|
|
59
78
|
const extensionLoggers = [...this.loggerService.getRegisteredLoggers()].filter(logger => logger.extensionId && logger.extensionId.toLowerCase() === extensionId);
|
|
60
79
|
for (const { resource } of extensionLoggers) {
|
|
61
80
|
if (this.loggerService.getLogLevel(resource) === currentDefaultLogLevel) {
|
|
@@ -64,14 +83,14 @@ let DefaultLogLevelsService = class DefaultLogLevelsService extends Disposable {
|
|
|
64
83
|
}
|
|
65
84
|
}
|
|
66
85
|
else {
|
|
67
|
-
const currentLogLevel = this._getDefaultLogLevel(
|
|
68
|
-
|
|
69
|
-
await this._writeLogLevelsToArgv(
|
|
86
|
+
const currentLogLevel = this._getDefaultLogLevel(defaultLogLevelsFromArgv);
|
|
87
|
+
defaultLogLevelsFromArgv.default = defaultLogLevel;
|
|
88
|
+
await this._writeLogLevelsToArgv(defaultLogLevelsFromArgv);
|
|
70
89
|
if (this.loggerService.getLogLevel() === currentLogLevel) {
|
|
71
90
|
this.loggerService.setLogLevel(defaultLogLevel);
|
|
72
91
|
}
|
|
73
92
|
}
|
|
74
|
-
this.
|
|
93
|
+
this.updateDefaultLogLevels(defaultLogLevelsFromArgv);
|
|
75
94
|
}
|
|
76
95
|
_getDefaultLogLevel(argvLogLevels, extension) {
|
|
77
96
|
if (extension) {
|