Path: blob/main/src/vs/workbench/contrib/editSessions/common/editSessionsLogService.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { joinPath } from '../../../../base/common/resources.js';6import { localize } from '../../../../nls.js';7import { IEnvironmentService } from '../../../../platform/environment/common/environment.js';8import { AbstractLogger, ILogger, ILoggerService } from '../../../../platform/log/common/log.js';9import { windowLogGroup } from '../../../services/log/common/logConstants.js';10import { IEditSessionsLogService, editSessionsLogId } from './editSessions.js';1112export class EditSessionsLogService extends AbstractLogger implements IEditSessionsLogService {1314declare readonly _serviceBrand: undefined;15private readonly logger: ILogger;1617constructor(18@ILoggerService loggerService: ILoggerService,19@IEnvironmentService environmentService: IEnvironmentService20) {21super();22this.logger = this._register(loggerService.createLogger(joinPath(environmentService.logsHome, `${editSessionsLogId}.log`), { id: editSessionsLogId, name: localize('cloudChangesLog', "Cloud Changes"), group: windowLogGroup }));23}2425trace(message: string, ...args: any[]): void {26this.logger.trace(message, ...args);27}2829debug(message: string, ...args: any[]): void {30this.logger.debug(message, ...args);31}3233info(message: string, ...args: any[]): void {34this.logger.info(message, ...args);35}3637warn(message: string, ...args: any[]): void {38this.logger.warn(message, ...args);39}4041error(message: string | Error, ...args: any[]): void {42this.logger.error(message, ...args);43}4445flush(): void {46this.logger.flush();47}48}495051