Datalayer VS Code Extension - v0.0.9
    Preparing search index...

    Enhanced tracking and logging for DatalayerClient SDK operations. Provides operation correlation, timing, error categorization, and user-friendly handling.

    Index

    Constructors

    Properties

    operations: Map<string, OperationData> = ...

    Map of operation IDs to their tracking data

    Methods

    • Create enhanced SDK handlers with comprehensive logging and error handling.

      Returns SDKHandlers

      SDKHandlers with beforeCall, afterCall, and onError implementations

    • Route SDK method to appropriate logger based on method name. Returns a no-op logger if ServiceLoggers is not yet initialized.

      Parameters

      • methodName: string

        Name of the SDK method

      Returns ILogger

      Logger instance for the method category

    • Get current operation statistics for debugging.

      Returns { activeOperations: number; operationsByMethod: Record<string, number> }

    • Handle SDK errors with smart categorization and user-friendly responses.

      Parameters

      • methodName: string

        Name of the SDK method that failed

      • error: unknown

        Error object thrown by the method

      • logger: {
            debug: (msg: string, context?: Record<string, unknown>) => void;
            error: (msg: string) => void;
            info: (msg: string) => void;
            warn: (msg: string, context?: Record<string, unknown>) => void;
        }

        Logger instance for error reporting

      Returns Promise<void>

    • Check if an error is network-related.

      Parameters

      • error: unknown

        Error object to check

      Returns boolean

      True if error is network-related, false otherwise

    • Sanitize arguments to remove sensitive data before logging.

      Parameters

      • args: unknown[]

        Raw arguments passed to SDK method

      Returns unknown[]

      Sanitized arguments safe for logging

    • Create a summary of the result for logging without exposing sensitive data.

      Parameters

      • result: unknown

        Result returned from SDK method

      Returns string

      Human-readable summary of the result