Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.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 * as nls from '../../../../../nls.js';
7
import { Disposable } from '../../../../../base/common/lifecycle.js';
8
import { INotebookLoggingService } from '../../common/notebookLoggingService.js';
9
import { ILogger, ILoggerService } from '../../../../../platform/log/common/log.js';
10
import { windowLogGroup } from '../../../../services/log/common/logConstants.js';
11
12
const logChannelId = 'notebook.rendering';
13
14
export class NotebookLoggingService extends Disposable implements INotebookLoggingService {
15
_serviceBrand: undefined;
16
17
static ID: string = 'notebook';
18
private readonly _logger: ILogger;
19
20
constructor(
21
@ILoggerService loggerService: ILoggerService,
22
) {
23
super();
24
this._logger = this._register(loggerService.createLogger(logChannelId, { name: nls.localize('renderChannelName', "Notebook"), group: windowLogGroup }));
25
}
26
27
debug(category: string, output: string): void {
28
this._logger.debug(`[${category}] ${output}`);
29
}
30
31
info(category: string, output: string): void {
32
this._logger.info(`[${category}] ${output}`);
33
}
34
35
warn(category: string, output: string): void {
36
this._logger.warn(`[${category}] ${output}`);
37
}
38
39
error(category: string, output: string): void {
40
this._logger.error(`[${category}] ${output}`);
41
}
42
}
43
44
45