Skip to content 

ITelemetryLogger Interface

Packages > @fluidframework/common-definitions > ITelemetryLogger

ITelemetryLogger interface contains various helper telemetry methods, encoding in one place schemas for various types of Fluid telemetry events. Creates sub-logger that appends properties to all events

Signature:

export interface ITelemetryLogger extends ITelemetryBaseLogger 

Extends: ITelemetryBaseLogger

Methods

List of methods of this class
Method Description
debugAssert(condition, event) Report ignorable errors in code logic or data integrity. Hosting app / container may want to optimize out these call sites and make them no-op. It may also show assert dialog in non-production builds of application.
logException(event, exception) Helper method to log exceptions
logGenericError(eventName, error) Helper method to log generic errors
send(event) Actual implementation that sends telemetry event Implemented by derived classes
sendErrorEvent(event, error) Send error telemetry event
sendPerformanceEvent(event, error) Send performance telemetry event
sendTelemetryEvent(event, error) Send information telemetry event
shipAssert(condition, event) Report ignorable errors in code logic or data integrity. Similar to debugAssert(), but is not supposed to be optimized out.

Methods

debugAssert

Report ignorable errors in code logic or data integrity. Hosting app / container may want to optimize out these call sites and make them no-op. It may also show assert dialog in non-production builds of application.

Signature:

debugAssert(condition: boolean, event?: ITelemetryErrorEvent): void;

Parameters

List of parameters
Parameter Type Description
condition boolean If false, assert is logged.
event ITelemetryErrorEvent

Returns:

void

logException

Helper method to log exceptions

Signature:

logException(event: ITelemetryErrorEvent, exception: any): void;

Parameters

List of parameters
Parameter Type Description
event ITelemetryErrorEvent the event to send
exception any Exception object to add to an event

Returns:

void

logGenericError

Helper method to log generic errors

Signature:

logGenericError(eventName: string, error: any): void;

Parameters

List of parameters
Parameter Type Description
eventName string Name of the event
error any the error object to include in the event, require to be JSON-able

Returns:

void

send

Actual implementation that sends telemetry event Implemented by derived classes

Signature:

send(event: ITelemetryBaseEvent): void;

Parameters

List of parameters
Parameter Type Description
event ITelemetryBaseEvent Telemetry event to send over

Returns:

void

sendErrorEvent

Send error telemetry event

Signature:

sendErrorEvent(event: ITelemetryErrorEvent, error?: any): void;

Parameters

List of parameters
Parameter Type Description
event ITelemetryErrorEvent Event to send
error any

Returns:

void

sendPerformanceEvent

Send performance telemetry event

Signature:

sendPerformanceEvent(event: ITelemetryPerformanceEvent, error?: any): void;

Parameters

List of parameters
Parameter Type Description
event ITelemetryPerformanceEvent Event to send
error any

Returns:

void

sendTelemetryEvent

Send information telemetry event

Signature:

sendTelemetryEvent(event: ITelemetryGenericEvent, error?: any): void;

Parameters

List of parameters
Parameter Type Description
event ITelemetryGenericEvent Event to send
error any optional error object to log

Returns:

void

shipAssert

Report ignorable errors in code logic or data integrity. Similar to debugAssert(), but is not supposed to be optimized out.

Signature:

shipAssert(condition: boolean, event?: ITelemetryErrorEvent): void;

Parameters

List of parameters
Parameter Type Description
condition boolean If false, assert is logged.
event ITelemetryErrorEvent

Returns:

void