Skip to content

log

const log: {
setMode: void;
isEnabled: boolean;
liveMode: void;
practiceMode: void;
getSdkLogs: Promise<SDKLogEntry[]>;
searchSdkLogs: Promise<SDKLogEntry[]>;
debug: void;
info: void;
warn: void;
error: void;
};

Defined in: domains/log.ts:84

setMode(enabled): void;

Enable or disable debug mode.

Parameter Type Description
enabled boolean Pass true to enable, false to disable.

void

isEnabled(): boolean;

Check whether debug mode is currently enabled.

boolean

true if debug mode is on.

liveMode(uri?): void;

Mark the current session as a live (non-practice) presentation.

Parameter Type Default value Description
uri string '' Optional URI or identifier to associate with the event.

void

practiceMode(uri?): void;

Mark the current session as a practice presentation.

Parameter Type Default value Description
uri string '' Optional URI or identifier to associate with the event.

void

getSdkLogs(filter?): Promise<SDKLogEntry[]>;

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).

Parameter Type Description
filter? SDKLogFilter Optional filter by level, domain, function, date range, retries, and limit.

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(text, filter?): Promise<SDKLogEntry[]>;

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.

Parameter Type Description
text string The search string.
filter? SDKLogFilter Optional pre-filter applied before the text search.

Promise<SDKLogEntry[]>

Array of matching SDKLogEntry objects.

MobileLockerError on network failure or server error.

debug(message, metadata?): void;

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

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void

info(message, metadata?): void;

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

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void

mobilelocker.log.info('User selected product', { productId: 42, slide: 'overview' })
warn(message, metadata?): void;

Write a warn-level log entry into the SDK log store.

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void

error(message, metadata?): void;

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

Parameter Type Description
message string Human-readable description of the event.
metadata? Record<string, unknown> Optional key/value data to attach to the entry.

void