未验证 提交 c0d1f91a 编写于 作者: R Ramya Rao 提交者: GitHub

Add output channel for telemetry.log file (#58846)

* Add output channel for telemetry.log file

* Explain telemetry.log file in the first line
上级 96033fee
......@@ -101,6 +101,8 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
const environmentService = accessor.get(IEnvironmentService);
const { appRoot, extensionsPath, extensionDevelopmentLocationURI, isBuilt, installSourcePath } = environmentService;
const telemetryLogService = new FollowerLogService(logLevelClient, createSpdLogService('telemetry', initData.logLevel, environmentService.logsPath));
telemetryLogService.info('The below are logs for every telemetry event sent from VS Code once the log level is set to trace.');
telemetryLogService.info('===========================================================');
let appInsightsAppender: ITelemetryAppender = NullAppender;
if (product.aiConfig && product.aiConfig.asimovKey && isBuilt) {
......
......@@ -6,4 +6,5 @@
export const mainLogChannelId = 'mainLog';
export const sharedLogChannelId = 'sharedLog';
export const rendererLogChannelId = 'rendererLog';
export const extHostLogChannelId = 'extHostLog';
\ No newline at end of file
export const extHostLogChannelId = 'extHostLog';
export const telemetryLogChannelId = 'telemetryLog';
\ No newline at end of file
......@@ -17,12 +17,14 @@ import * as Constants from 'vs/workbench/parts/logs/common/logConstants';
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { OpenLogsFolderAction, SetLogLevelAction } from 'vs/workbench/parts/logs/electron-browser/logsActions';
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
class LogOutputChannels extends Disposable implements IWorkbenchContribution {
constructor(
@IWindowService windowService: IWindowService,
@IEnvironmentService environmentService: IEnvironmentService,
@ILogService logService: ILogService
) {
super();
let outputChannelRegistry = Registry.as<IOutputChannelRegistry>(OutputExt.OutputChannels);
......@@ -30,6 +32,14 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution {
outputChannelRegistry.registerChannel({ id: Constants.sharedLogChannelId, label: nls.localize('sharedLog', "Shared"), file: URI.file(join(environmentService.logsPath, `sharedprocess.log`)), log: true });
outputChannelRegistry.registerChannel({ id: Constants.rendererLogChannelId, label: nls.localize('rendererLog', "Window"), file: URI.file(join(environmentService.logsPath, `renderer${windowService.getCurrentWindowId()}.log`)), log: true });
const registerTelemetryChannel = (level) => {
if (level === LogLevel.Trace && !outputChannelRegistry.getChannel(Constants.telemetryLogChannelId)) {
outputChannelRegistry.registerChannel({ id: Constants.telemetryLogChannelId, label: nls.localize('telemetryLog', "Telemetry"), file: URI.file(join(environmentService.logsPath, `telemetry.log`)), log: true });
}
};
registerTelemetryChannel(logService.getLevel());
logService.onDidChangeLogLevel(registerTelemetryChannel);
const workbenchActionsRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
const devCategory = nls.localize('developer', "Developer");
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenLogsFolderAction, OpenLogsFolderAction.ID, OpenLogsFolderAction.LABEL), 'Developer: Open Log Folder', devCategory);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册