Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/editSessions/common/editSessionsLogService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { joinPath } from '../../../../base/common/resources.js';
7
import { localize } from '../../../../nls.js';
8
import { IEnvironmentService } from '../../../../platform/environment/common/environment.js';
9
import { AbstractLogger, ILogger, ILoggerService } from '../../../../platform/log/common/log.js';
10
import { windowLogGroup } from '../../../services/log/common/logConstants.js';
11
import { IEditSessionsLogService, editSessionsLogId } from './editSessions.js';
12
13
export class EditSessionsLogService extends AbstractLogger implements IEditSessionsLogService {
14
15
declare readonly _serviceBrand: undefined;
16
private readonly logger: ILogger;
17
18
constructor(
19
@ILoggerService loggerService: ILoggerService,
20
@IEnvironmentService environmentService: IEnvironmentService
21
) {
22
super();
23
this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${editSessionsLogId}.log`), { id: editSessionsLogId, name: localize('cloudChangesLog', "Cloud Changes"), group: windowLogGroup }));
24
}
25
26
trace(message: string, ...args: any[]): void {
27
this.logger.trace(message, ...args);
28
}
29
30
debug(message: string, ...args: any[]): void {
31
this.logger.debug(message, ...args);
32
}
33
34
info(message: string, ...args: any[]): void {
35
this.logger.info(message, ...args);
36
}
37
38
warn(message: string, ...args: any[]): void {
39
this.logger.warn(message, ...args);
40
}
41
42
error(message: string | Error, ...args: any[]): void {
43
this.logger.error(message, ...args);
44
}
45
46
flush(): void {
47
this.logger.flush();
48
}
49
}
50
51