Mobile Locker JavaScript SDK
    Preparing search index...

    Variable logConst

    log: {
        setMode(enabled: boolean): void;
        isEnabled(): boolean;
        liveMode(uri?: string): void;
        practiceMode(uri?: string): void;
        getSdkLogs(filter?: SDKLogFilter): Promise<SDKLogEntry[]>;
        searchSdkLogs(text: string, filter?: SDKLogFilter): Promise<SDKLogEntry[]>;
        debug(message: string, metadata?: Record<string, unknown>): void;
        info(message: string, metadata?: Record<string, unknown>): void;
        warn(message: string, metadata?: Record<string, unknown>): void;
        error(message: string, metadata?: Record<string, unknown>): void;
    } = ...

    Type Declaration

    • setMode: function
      • Enable or disable debug mode.

        Parameters

        • enabled: boolean

          Pass true to enable, false to disable.

        Returns void

    • isEnabled: function
      • Check whether debug mode is currently enabled.

        Returns boolean

        true if debug mode is on.

    • liveMode: function
      • Mark the current session as a live (non-practice) presentation.

        Parameters

        • uri: string = ''

          Optional URI or identifier to associate with the event.

        Returns void

    • practiceMode: function
      • Mark the current session as a practice presentation.

        Parameters

        • uri: string = ''

          Optional URI or identifier to associate with the event.

        Returns void

    • getSdkLogs: function
      • Retrieve structured SDK log entries with optional filtering.

        In the iOS app, fetches from the server-side GRDB table scoped to the current team, user, presentation, and device session. Outside the app, reads from IndexedDB via localforage (same entry shape, up to 1,000 entries).

        Parameters

        • Optionalfilter: SDKLogFilter

          Optional filter by level, domain, function, date range, retries, and limit.

        Returns Promise<SDKLogEntry[]>

        Array of SDKLogEntry objects, newest first.

        MobileLockerError on network failure or server error.

        const errors = await mobilelocker.log.getSdkLogs({ level: 'error', domain: 'crm' })
        
    • searchSdkLogs: function
      • Full-text search across SDK log entries.

        Searches the message field and stringified metadata. Accepts the same filter options as getSdkLogs to narrow the scope before searching.

        Parameters

        • text: string

          The search string.

        • Optionalfilter: SDKLogFilter

          Optional pre-filter applied before the text search.

        Returns Promise<SDKLogEntry[]>

        Array of matching SDKLogEntry objects.

        MobileLockerError on network failure or server error.

    • debug: function
      • Write a debug-level log entry into the SDK log store.

        Parameters

        • message: string

          Human-readable description of the event.

        • Optionalmetadata: Record<string, unknown>

          Optional key/value data to attach to the entry.

        Returns void

    • info: function
      • Write an info-level log entry into the SDK log store.

        Parameters

        • message: string

          Human-readable description of the event.

        • Optionalmetadata: Record<string, unknown>

          Optional key/value data to attach to the entry.

        Returns void

        mobilelocker.log.info('User selected product', { productId: 42, slide: 'overview' })
        
    • warn: function
      • Write a warn-level log entry into the SDK log store.

        Parameters

        • message: string

          Human-readable description of the event.

        • Optionalmetadata: Record<string, unknown>

          Optional key/value data to attach to the entry.

        Returns void

    • error: function
      • Write an error-level log entry into the SDK log store.

        Parameters

        • message: string

          Human-readable description of the event.

        • Optionalmetadata: Record<string, unknown>

          Optional key/value data to attach to the entry.

        Returns void