Type Parameters

Implements

Constructors

Properties

config: CfgType
getWParam: (() => number)

Function used to identify the get w parameter used to identify status bit to some channels

isInitialized: (() => boolean)

Returns a value that indicates whether the instance has already been previously initialized.

The current logger instance for this instance.

pluginVersionString: string

The formatted string of the installed plugins that contain a version number

pluginVersionStringArr: string[]

An array of the installed plugins that provide a version

Methods

  • Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.

    Parameters

    Returns boolean | void

    boolean - True means the extension class will call updateState otherwise the Core will

  • Watches and tracks status of initialization process

    Returns number

    ActiveStatus

    3.3.0 If returned status is active, it means initialization process is completed. If returned status is pending, it means the initialization process is waiting for promieses to be resolved. If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.

  • Add a new plugin to the installation

    Type Parameters

    Parameters

    • plugin: T

      The new plugin to add

    • OptionalreplaceExisting: boolean

      should any existing plugin be replaced, default is false

    • OptionaldoAsync: boolean

      Should the add be performed asynchronously

    • OptionaladdCb: ((added?: boolean) => void)

      [Optional] callback to call after the plugin has been added

        • (added?): void
        • Parameters

          • Optionaladded: boolean

          Returns void

    Returns void

  • Flush and send any batched / cached data immediately

    Parameters

    • OptionalisAsync: boolean
    • OptionalcallBack: ((flushComplete?: boolean) => void)

      if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.

        • (flushComplete?): void
        • Parameters

          • OptionalflushComplete: boolean

          Returns void

    • OptionalsendReason: SendRequestReason

      specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified

    Returns void

    • true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
  • Enable the timer that checks the logger.queue for log messages to be flushed. Note: Since 3.0.1 and 2.8.13 this is no longer an interval timer but is a normal timer that is only started when this function is called and then subsequently only if there are any logger.queue messages to be sent.

    Parameters

    • OptionaleventName: string

    Returns ITimerHandler

  • Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return true stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously. If you pass isAsync as true (also the default) and DO NOT pass a callback function then an IPromise will be returned which will resolve once the unload is complete. The actual implementation of the IPromise will be a native Promise (if supported) or the default as supplied by ts-async library

    Parameters

    • OptionalisAsync: boolean

      Can the unload be performed asynchronously (default)

    • OptionalunloadComplete: ((unloadState: ITelemetryUnloadState) => void)

      An optional callback that will be called once the unload has completed

    • OptionalcbTimeout: number

      An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.

    Returns void | IPromise<ITelemetryUnloadState>

    Nothing or if occurring asynchronously a IPromise which will be resolved once the unload is complete, the IPromise will only be returned when no callback is provided and isAsync is true

  • Update the configuration used and broadcast the changes to all loaded plugins

    Parameters

    • newConfig: CfgType

      The new configuration is apply

    • OptionalmergeExisting: boolean

      Should the new configuration merge with the existing or just replace it. Default is to true.

    Returns void