Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TelemetrySender

The telemetry sender is the contract between a telemetry logger and some telemetry service. Note that extensions must NOT call the methods of their sender directly as the logger provides extra guards and cleaning.

const sender: vscode.TelemetrySender = {...};
const logger = vscode.env.createTelemetryLogger(sender);

// GOOD - uses the logger
logger.logUsage('myEvent', { myData: 'myValue' });

// BAD - uses the sender directly: no data cleansing, ignores user settings, no echoing to the telemetry output channel etc
sender.logEvent('myEvent', { myData: 'myValue' });

Hierarchy

  • TelemetrySender

Index

Methods(3)

sendEventData

  • sendEventData(eventName: string, data?: Record<string, any>): void
  • Function to send event data without a stacktrace. Used within a TelemetryLogger

    Parameters

    • eventName: string

      The name of the event which you are logging

    • Optional data: Record<string, any>

      A serializable key value pair that is being logged

    Returns void

sendErrorData

  • sendErrorData(error: Error, data?: Record<string, any>): void
  • Function to send an error. Used within a TelemetryLogger

    Parameters

    • error: Error

      The error being logged

    • Optional data: Record<string, any>

      Any additional data to be collected with the exception

    Returns void

Optional flush

Generated by TypeDoc. Maintained by 紫升

Links: 搜外友链, 69中文网