@codingame/monaco-vscode-log-service-override 11.1.2 → 12.0.1

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 CHANGED
@@ -1,2 +1,12 @@
1
- export * from 'vscode/service-override/log';
2
- export { default } from 'vscode/service-override/log';
1
+ import type { IEditorOverrideServices } from "vscode/vscode/vs/editor/standalone/browser/standaloneServices";
2
+ import { type ILogger, LogLevel, ConsoleLogger } from "vscode/vscode/vs/platform/log/common/log";
3
+ import { type IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
4
+ declare function getServiceOverride(): IEditorOverrideServices;
5
+ /**
6
+ * @deprecated Provide logLevel via the services `initialize` function `configuration.developmentOptions.logLevel` parameter
7
+ */
8
+ declare function getServiceOverride(logLevel?: LogLevel): IEditorOverrideServices;
9
+ export default getServiceOverride;
10
+ export declare function registerAdditionalLogger(logger: ILogger): IDisposable;
11
+ export { ConsoleLogger };
12
+ export type { ILogger };
package/index.js CHANGED
@@ -1,2 +1,64 @@
1
- export { default, registerAdditionalLogger } from './log.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
3
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
4
+ import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
5
+ import { getLogLevel } from 'vscode/vscode/vs/platform/log/common/log';
2
6
  export { ConsoleLogger } from 'vscode/vscode/vs/platform/log/common/log';
7
+ import { ILoggerService, ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
8
+ import { FileLoggerService } from './vscode/src/vs/platform/log/common/fileLog.js';
9
+ import { LogService } from 'vscode/vscode/vs/platform/log/common/logService';
10
+ import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
11
+ import { windowLogId } from 'vscode/vscode/vs/workbench/services/log/common/logConstants';
12
+ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
13
+ import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
14
+ import { DefaultLogLevelsService } from './vscode/src/vs/workbench/contrib/logs/common/defaultLogLevels.js';
15
+ import { IDefaultLogLevelsService } from 'vscode/vscode/vs/workbench/contrib/logs/common/defaultLogLevels.service';
16
+ import getServiceOverride$1 from '@codingame/monaco-vscode-environment-service-override';
17
+ import { logsPath } from 'vscode/workbench';
18
+ import { checkServicesNotInitialized } from 'vscode/lifecycle';
19
+ import { rendererLogLabel } from './override/vs/workbench/browser/web.main.js';
20
+ import './vscode/src/vs/workbench/contrib/logs/common/logs.contribution.js';
21
+
22
+ let _FileLoggerService = class _FileLoggerService extends FileLoggerService {
23
+ constructor(logLevel, fileService, environmentService) {
24
+ super(logLevel ?? getLogLevel(environmentService), logsPath, fileService);
25
+ }
26
+ };
27
+ _FileLoggerService = __decorate([
28
+ __param(1, IFileService),
29
+ __param(2, IEnvironmentService)
30
+ ], _FileLoggerService);
31
+ const otherLoggers = [];
32
+ let _LogService = class _LogService extends LogService {
33
+ constructor(loggerService, environmentService) {
34
+ const logger = loggerService.createLogger(environmentService.logFile, {
35
+ id: windowLogId,
36
+ name: rendererLogLabel
37
+ });
38
+ super(logger, otherLoggers);
39
+ }
40
+ };
41
+ _LogService = __decorate([
42
+ __param(0, ILoggerService),
43
+ __param(1, IWorkbenchEnvironmentService)
44
+ ], _LogService);
45
+ function getServiceOverride(logLevel) {
46
+ return {
47
+ ...getServiceOverride$1(),
48
+ [ILoggerService.toString()]: new SyncDescriptor(_FileLoggerService, [logLevel], true),
49
+ [ILogService.toString()]: new SyncDescriptor(_LogService, [], true),
50
+ [IDefaultLogLevelsService.toString()]: new SyncDescriptor(DefaultLogLevelsService, [], true)
51
+ };
52
+ }
53
+ function registerAdditionalLogger(logger) {
54
+ checkServicesNotInitialized();
55
+ otherLoggers.push(logger);
56
+ return toDisposable(() => {
57
+ const idx = otherLoggers.indexOf(logger);
58
+ if (idx >= 0) {
59
+ otherLoggers.splice(idx, 1);
60
+ }
61
+ });
62
+ }
63
+
64
+ export { getServiceOverride as default, registerAdditionalLogger };
@@ -0,0 +1 @@
1
+ export declare const rendererLogLabel: string;
@@ -1,5 +1,6 @@
1
+
1
2
  import { localize } from 'vscode/vscode/vs/nls';
2
3
 
3
- const rendererLogLabel = ( localize(3282, 'Window'));
4
+ const rendererLogLabel = ( localize(0, 'Window'));
4
5
 
5
6
  export { rendererLogLabel };
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-log-service-override",
3
- "version": "11.1.2",
3
+ "version": "12.0.1",
4
+ "private": false,
5
+ "description": "VSCode public API plugged on the monaco editor - log service-override",
4
6
  "keywords": [],
5
7
  "author": {
6
8
  "name": "CodinGame",
@@ -12,8 +14,15 @@
12
14
  "url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
13
15
  },
14
16
  "type": "module",
15
- "private": false,
16
- "description": "VSCode public API plugged on the monaco editor - log service-override",
17
+ "dependencies": {
18
+ "@codingame/monaco-vscode-7b77bc98-d4d5-5442-b972-c926eb6db528-common": "12.0.1",
19
+ "@codingame/monaco-vscode-abed5a84-8a82-5f84-9412-88a736235bae-common": "12.0.1",
20
+ "@codingame/monaco-vscode-cea4d01f-6526-5c2f-8b09-b168fead499f-common": "12.0.1",
21
+ "@codingame/monaco-vscode-environment-service-override": "12.0.1",
22
+ "vscode": "npm:@codingame/monaco-vscode-api@12.0.1"
23
+ },
24
+ "peerDependencies": {},
25
+ "peerDependenciesMeta": {},
17
26
  "main": "index.js",
18
27
  "module": "index.js",
19
28
  "types": "index.d.ts",
@@ -22,11 +31,12 @@
22
31
  "default": "./index.js"
23
32
  },
24
33
  "./vscode/*": {
25
- "default": "./vscode/src/*.js"
34
+ "default": "./vscode/src/*.js",
35
+ "types": "./vscode/src/*.d.ts"
36
+ },
37
+ "./*": {
38
+ "default": "./*.js",
39
+ "types": "./*.d.ts"
26
40
  }
27
- },
28
- "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@11.1.2",
30
- "@codingame/monaco-vscode-environment-service-override": "11.1.2"
31
41
  }
32
42
  }
@@ -0,0 +1,9 @@
1
+ import { URI } from "vscode/vscode/vs/base/common/uri";
2
+ import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
3
+ import { AbstractLoggerService, ILogger, ILoggerOptions, LogLevel } from "vscode/vscode/vs/platform/log/common/log";
4
+ import { ILoggerService } from "vscode/vscode/vs/platform/log/common/log.service";
5
+ export declare class FileLoggerService extends AbstractLoggerService implements ILoggerService {
6
+ private readonly fileService;
7
+ constructor(logLevel: LogLevel, logsHome: URI, fileService: IFileService);
8
+ protected doCreateLogger(resource: URI, logLevel: LogLevel, options?: ILoggerOptions): ILogger;
9
+ }
@@ -1,10 +1,11 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { ThrottledDelayer } from 'vscode/vscode/vs/base/common/async';
3
4
  import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
4
5
  import { joinPath, dirname, basename } from 'vscode/vscode/vs/base/common/resources';
5
- import { ByteSize, whenProviderRegistered } from 'vscode/vscode/vs/platform/files/common/files';
6
+ import { ByteSize, FileOperationResult, whenProviderRegistered } from 'vscode/vscode/vs/platform/files/common/files';
6
7
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
7
- import { BufferLogger } from 'vscode/vscode/vs/platform/log/common/bufferLog';
8
+ import { BufferLogger } from '@codingame/monaco-vscode-cea4d01f-6526-5c2f-8b09-b168fead499f-common/vscode/vs/platform/log/common/bufferLog';
8
9
  import { AbstractMessageLogger, LogLevel, AbstractLoggerService } from 'vscode/vscode/vs/platform/log/common/log';
9
10
 
10
11
  const MAX_FILE_SIZE = 5 * ByteSize.MB;
@@ -41,7 +42,7 @@ let FileLogger = class FileLogger extends AbstractMessageLogger {
41
42
  await this.fileService.createFile(this.resource);
42
43
  }
43
44
  catch (error) {
44
- if (error.fileOperationResult !== 3 ) {
45
+ if (error.fileOperationResult !== FileOperationResult.FILE_MODIFIED_SINCE) {
45
46
  throw error;
46
47
  }
47
48
  }
@@ -0,0 +1,38 @@
1
+ import { LogLevel } from "vscode/vscode/vs/platform/log/common/log";
2
+ import { ILoggerService } from "vscode/vscode/vs/platform/log/common/log.service";
3
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
4
+ import { IWorkbenchEnvironmentService } from "vscode/vscode/vs/workbench/services/environment/common/environmentService.service";
5
+ import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
6
+ import { IJSONEditingService } from "vscode/vscode/vs/workbench/services/configuration/common/jsonEditing.service";
7
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
8
+ import { IDefaultLogLevelsService } from "vscode/vscode/vs/workbench/contrib/logs/common/defaultLogLevels.service";
9
+ interface ParsedArgvLogLevels {
10
+ default?: LogLevel;
11
+ extensions?: [
12
+ string,
13
+ LogLevel
14
+ ][];
15
+ }
16
+ export type DefaultLogLevels = Required<Readonly<ParsedArgvLogLevels>>;
17
+ export declare class DefaultLogLevelsService extends Disposable implements IDefaultLogLevelsService {
18
+ private readonly environmentService;
19
+ private readonly fileService;
20
+ private readonly jsonEditingService;
21
+ private readonly logService;
22
+ private readonly loggerService;
23
+ _serviceBrand: undefined;
24
+ private _onDidChangeDefaultLogLevels;
25
+ readonly onDidChangeDefaultLogLevels: import("vscode/vscode/vs/base/common/event").Event<void>;
26
+ constructor(environmentService: IWorkbenchEnvironmentService, fileService: IFileService, jsonEditingService: IJSONEditingService, logService: ILogService, loggerService: ILoggerService);
27
+ getDefaultLogLevels(): Promise<DefaultLogLevels>;
28
+ getDefaultLogLevel(extensionId?: string): Promise<LogLevel>;
29
+ setDefaultLogLevel(defaultLogLevel: LogLevel, extensionId?: string): Promise<void>;
30
+ private _getDefaultLogLevel;
31
+ private _writeLogLevelsToArgv;
32
+ private _parseLogLevelsFromArgv;
33
+ migrateLogLevels(): Promise<void>;
34
+ private _readLogLevelsFromArgv;
35
+ private _getDefaultLogLevelFromEnv;
36
+ private _getExtensionsDefaultLogLevelsFromEnv;
37
+ }
38
+ export {};
@@ -1,12 +1,14 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { getLogLevel, LogLevelToString, parseLogLevel } from 'vscode/vscode/vs/platform/log/common/log';
3
4
  import { ILogService, ILoggerService } from 'vscode/vscode/vs/platform/log/common/log.service';
4
5
  import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
5
- import { toFileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
6
+ import { toFileOperationResult, FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
6
7
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
7
8
  import { IJSONEditingService } from 'vscode/vscode/vs/workbench/services/configuration/common/jsonEditing.service';
8
9
  import { isUndefined, isString } from 'vscode/vscode/vs/base/common/types';
9
- import { EXTENSION_IDENTIFIER_WITH_LOG_REGEX } from 'vscode/vscode/vs/platform/environment/common/environmentService';
10
+ import { EXTENSION_IDENTIFIER_WITH_LOG_REGEX } from '@codingame/monaco-vscode-abed5a84-8a82-5f84-9412-88a736235bae-common/vscode/vs/platform/environment/common/environmentService';
11
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
10
12
  import { parse } from 'vscode/vscode/vs/base/common/json';
11
13
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
12
14
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
@@ -127,7 +129,7 @@ let DefaultLogLevelsService = class DefaultLogLevelsService extends Disposable {
127
129
  return isString(argv['log-level']) ? [argv['log-level']] : Array.isArray(argv['log-level']) ? argv['log-level'] : [];
128
130
  }
129
131
  catch (error) {
130
- if (toFileOperationResult(error) !== 1 ) {
132
+ if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) {
131
133
  this.logService.error(error);
132
134
  }
133
135
  }
@@ -1,9 +1,10 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { localize2, localize } from 'vscode/vscode/vs/nls';
3
4
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
4
5
  import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
5
6
  import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
6
- import { SetLogLevelAction } from 'vscode/vscode/vs/workbench/contrib/logs/common/logsActions';
7
+ import { SetLogLevelAction } from '@codingame/monaco-vscode-7b77bc98-d4d5-5442-b972-c926eb6db528-common/vscode/vs/workbench/contrib/logs/common/logsActions';
7
8
  import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
8
9
  import { whenProviderRegistered } from 'vscode/vscode/vs/platform/files/common/files';
9
10
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
@@ -12,6 +13,7 @@ import { IOutputService } from 'vscode/vscode/vs/workbench/services/output/commo
12
13
  import { Disposable, DisposableMap, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
13
14
  import { CONTEXT_LOG_LEVEL, LogLevelToString, isLogLevel } from 'vscode/vscode/vs/platform/log/common/log';
14
15
  import { ILogService, ILoggerService } from 'vscode/vscode/vs/platform/log/common/log.service';
16
+ import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
15
17
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
16
18
  import { Event } from 'vscode/vscode/vs/base/common/event';
17
19
  import { showWindowLogActionId, windowLogId } from 'vscode/vscode/vs/workbench/services/log/common/logConstants';
@@ -41,7 +43,7 @@ registerAction2(class extends Action2 {
41
43
  constructor() {
42
44
  super({
43
45
  id: 'workbench.action.setDefaultLogLevel',
44
- title: ( localize2(3283, "Set Default Log Level")),
46
+ title: ( localize2(7015, "Set Default Log Level")),
45
47
  category: Categories.Developer,
46
48
  });
47
49
  }
@@ -57,9 +59,9 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
57
59
  this.contextKeyService = contextKeyService;
58
60
  this.fileService = fileService;
59
61
  this.uriIdentityService = uriIdentityService;
60
- this.contextKeys = ( (new CounterSet()));
61
- this.outputChannelRegistry = ( (Registry.as(Extensions.OutputChannels)));
62
- this.loggerDisposables = this._register(( (new DisposableMap())));
62
+ this.contextKeys = ( new CounterSet());
63
+ this.outputChannelRegistry = ( Registry.as(Extensions.OutputChannels));
64
+ this.loggerDisposables = this._register(( new DisposableMap()));
63
65
  const contextKey = CONTEXT_LOG_LEVEL.bindTo(contextKeyService);
64
66
  contextKey.set(LogLevelToString(loggerService.getLogLevel()));
65
67
  this._register(loggerService.onDidChangeLogLevel(e => {
@@ -91,7 +93,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
91
93
  if (logger.when) {
92
94
  const contextKeyExpr = ContextKeyExpr.deserialize(logger.when);
93
95
  if (contextKeyExpr) {
94
- for (const key of ( (contextKeyExpr.keys()))) {
96
+ for (const key of ( contextKeyExpr.keys())) {
95
97
  this.contextKeys.add(key);
96
98
  }
97
99
  if (!this.contextKeyService.contextMatchesRules(contextKeyExpr)) {
@@ -122,7 +124,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
122
124
  if (logger.when) {
123
125
  const contextKeyExpr = ContextKeyExpr.deserialize(logger.when);
124
126
  if (contextKeyExpr) {
125
- for (const key of ( (contextKeyExpr.keys()))) {
127
+ for (const key of ( contextKeyExpr.keys())) {
126
128
  this.contextKeys.delete(key);
127
129
  }
128
130
  }
@@ -135,7 +137,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
135
137
  if (channel && this.uriIdentityService.extUri.isEqual(channel.file, logger.resource)) {
136
138
  return;
137
139
  }
138
- const disposables = ( (new DisposableStore()));
140
+ const disposables = ( new DisposableStore());
139
141
  const promise = createCancelablePromise(async (token) => {
140
142
  await whenProviderRegistered(logger.resource, this.fileService);
141
143
  try {
@@ -147,7 +149,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
147
149
  }
148
150
  const hasToAppendRemote = existingChannel && logger.resource.scheme === Schemas.vscodeRemote;
149
151
  const id = hasToAppendRemote ? `${logger.id}.remote` : logger.id;
150
- const label = hasToAppendRemote ? ( localize(3284, "{0} (Remote)", logger.name ?? logger.id)) : logger.name ?? logger.id;
152
+ const label = hasToAppendRemote ? ( localize(7016, "{0} (Remote)", logger.name ?? logger.id)) : logger.name ?? logger.id;
151
153
  this.outputChannelRegistry.registerChannel({ id, label, file: logger.resource, log: true, extensionId: logger.extensionId });
152
154
  disposables.add(toDisposable(() => this.outputChannelRegistry.removeChannel(id)));
153
155
  if (remoteLogger) {
@@ -156,15 +158,15 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
156
158
  }
157
159
  catch (error) {
158
160
  if (!isCancellationError(error)) {
159
- this.logService.error('Error while registering log channel', ( (logger.resource.toString())), getErrorMessage(error));
161
+ this.logService.error('Error while registering log channel', ( logger.resource.toString()), getErrorMessage(error));
160
162
  }
161
163
  }
162
164
  });
163
165
  disposables.add(toDisposable(() => promise.cancel()));
164
- this.loggerDisposables.set(( (logger.resource.toString())), disposables);
166
+ this.loggerDisposables.set(( logger.resource.toString()), disposables);
165
167
  }
166
168
  deregisterLogChannel(logger) {
167
- this.loggerDisposables.deleteAndDispose(( (logger.resource.toString())));
169
+ this.loggerDisposables.deleteAndDispose(( logger.resource.toString()));
168
170
  }
169
171
  async whenFileExists(file, trial, token) {
170
172
  const exists = await this.fileService.exists(file);
@@ -172,12 +174,12 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
172
174
  return;
173
175
  }
174
176
  if (token.isCancellationRequested) {
175
- throw ( (new CancellationError()));
177
+ throw ( new CancellationError());
176
178
  }
177
179
  if (trial > 10) {
178
- throw ( (new Error(`Timed out while waiting for file to be created`)));
180
+ throw ( new Error(`Timed out while waiting for file to be created`));
179
181
  }
180
- this.logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, ( (file.toString())));
182
+ this.logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, ( file.toString()));
181
183
  await timeout(1000, token);
182
184
  await this.whenFileExists(file, trial + 1, token);
183
185
  }
@@ -186,7 +188,7 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
186
188
  constructor() {
187
189
  super({
188
190
  id: showWindowLogActionId,
189
- title: ( localize2(3285, "Show Window Log")),
191
+ title: ( localize2(7017, "Show Window Log")),
190
192
  category: Categories.Developer,
191
193
  f1: true
192
194
  });
@@ -198,20 +200,20 @@ let LogOutputChannels = class LogOutputChannels extends Disposable {
198
200
  }));
199
201
  }
200
202
  };
201
- LogOutputChannels = ( (__decorate([
202
- ( (__param(0, ILogService))),
203
- ( (__param(1, ILoggerService))),
204
- ( (__param(2, IContextKeyService))),
205
- ( (__param(3, IFileService))),
206
- ( (__param(4, IUriIdentityService)))
207
- ], LogOutputChannels)));
203
+ LogOutputChannels = ( __decorate([
204
+ ( __param(0, ILogService)),
205
+ ( __param(1, ILoggerService)),
206
+ ( __param(2, IContextKeyService)),
207
+ ( __param(3, IFileService)),
208
+ ( __param(4, IUriIdentityService))
209
+ ], LogOutputChannels));
208
210
  let LogLevelMigration = class LogLevelMigration {
209
211
  constructor(defaultLogLevelsService) {
210
212
  defaultLogLevelsService.migrateLogLevels();
211
213
  }
212
214
  };
213
- LogLevelMigration = ( (__decorate([
214
- ( (__param(0, IDefaultLogLevelsService)))
215
- ], LogLevelMigration)));
216
- ( (Registry.as(Extensions$1.Workbench))).registerWorkbenchContribution(LogOutputChannels, 3 );
217
- ( (Registry.as(Extensions$1.Workbench))).registerWorkbenchContribution(LogLevelMigration, 4 );
215
+ LogLevelMigration = ( __decorate([
216
+ ( __param(0, IDefaultLogLevelsService))
217
+ ], LogLevelMigration));
218
+ ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(LogOutputChannels, LifecyclePhase.Restored);
219
+ ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(LogLevelMigration, LifecyclePhase.Eventually);
package/log.js DELETED
@@ -1,63 +0,0 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
3
- import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
4
- import { getLogLevel } from 'vscode/vscode/vs/platform/log/common/log';
5
- export { ConsoleLogger } from 'vscode/vscode/vs/platform/log/common/log';
6
- import { ILoggerService, ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
7
- import { FileLoggerService } from './vscode/src/vs/platform/log/common/fileLog.js';
8
- import { LogService } from 'vscode/vscode/vs/platform/log/common/logService';
9
- import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
10
- import { windowLogId } from 'vscode/vscode/vs/workbench/services/log/common/logConstants';
11
- import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
12
- import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
13
- import { DefaultLogLevelsService } from './vscode/src/vs/workbench/contrib/logs/common/defaultLogLevels.js';
14
- import { IDefaultLogLevelsService } from 'vscode/vscode/vs/workbench/contrib/logs/common/defaultLogLevels.service';
15
- import getServiceOverride$1 from '@codingame/monaco-vscode-environment-service-override';
16
- import { logsPath } from 'vscode/workbench';
17
- import { checkServicesNotInitialized } from 'vscode/lifecycle';
18
- import { rendererLogLabel } from './override/vs/workbench/browser/web.main.js';
19
- import './vscode/src/vs/workbench/contrib/logs/common/logs.contribution.js';
20
-
21
- let _FileLoggerService = class _FileLoggerService extends FileLoggerService {
22
- constructor(logLevel, fileService, environmentService) {
23
- super(logLevel ?? getLogLevel(environmentService), logsPath, fileService);
24
- }
25
- };
26
- _FileLoggerService = __decorate([
27
- ( __param(1, IFileService)),
28
- ( __param(2, IEnvironmentService))
29
- ], _FileLoggerService);
30
- const otherLoggers = [];
31
- let _LogService = class _LogService extends LogService {
32
- constructor(loggerService, environmentService) {
33
- const logger = loggerService.createLogger(environmentService.logFile, {
34
- id: windowLogId,
35
- name: rendererLogLabel
36
- });
37
- super(logger, otherLoggers);
38
- }
39
- };
40
- _LogService = __decorate([
41
- ( __param(0, ILoggerService)),
42
- ( __param(1, IWorkbenchEnvironmentService))
43
- ], _LogService);
44
- function getServiceOverride(logLevel) {
45
- return {
46
- ...getServiceOverride$1(),
47
- [( ILoggerService.toString())]: new SyncDescriptor(_FileLoggerService, [logLevel], true),
48
- [( ILogService.toString())]: new SyncDescriptor(_LogService, [], true),
49
- [( IDefaultLogLevelsService.toString())]: new SyncDescriptor(DefaultLogLevelsService, [], true)
50
- };
51
- }
52
- function registerAdditionalLogger(logger) {
53
- checkServicesNotInitialized();
54
- otherLoggers.push(logger);
55
- return toDisposable(() => {
56
- const idx = otherLoggers.indexOf(logger);
57
- if (idx >= 0) {
58
- otherLoggers.splice(idx, 1);
59
- }
60
- });
61
- }
62
-
63
- export { getServiceOverride as default, registerAdditionalLogger };