interface IDiagnosticLogger {
    consoleLoggingLevel: (() => number);
    debugToConsole?(message: string): void;
    errorToConsole?(message: string): void;
    logInternalMessage?(severity: number, message: _InternalLogMessage): void;
    queue: _InternalLogMessage[];
    resetInternalMessageCount(): void;
    throwInternal(severity: number, msgId: number, msg: string, properties?: Object, isUserAct?: boolean): void;
    unload?(isAsync?: boolean): void | IPromise<void>;
    update?(updateState: ITelemetryUpdateState): void;
    warnToConsole(message: string): void;
}

Implemented by

Properties

consoleLoggingLevel: (() => number)

0: OFF 1: only critical (default) 2: critical + info

The internal logging queue

Methods

  • This will write an error to the console if possible. Provided by the default DiagnosticLogger instance, and internally the SDK will fall back to warnToConsole, however, direct callers MUST check for its existence on the logger as you can provide your own IDiagnosticLogger instance.

    Parameters

    • message: string

      The error message

    Returns void

  • This method will throw exceptions in debug mode or attempt to log the error as a console warning.

    Parameters

    • severity: number

      The severity of the log message

    • msgId: number
    • msg: string
    • Optionalproperties: Object
    • OptionalisUserAct: boolean

    Returns void

  • Unload and remove any state that this IDiagnosticLogger may be holding, this is generally called when the owning SDK is being unloaded.

    Parameters

    • OptionalisAsync: boolean

      Can the unload be performed asynchronously (default)

    Returns void | IPromise<void>

    If the unload occurs synchronously then nothing should be returned, if happening asynchronously then the function should return an IPromise / Promise to allow any listeners to wait for the operation to complete.