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
Type Declaration
Section titled “Type Declaration”setMode()
Section titled “setMode()”setMode(enabled): void;Enable or disable debug mode.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
enabled |
boolean |
Pass true to enable, false to disable. |
Returns
Section titled “Returns”void
isEnabled()
Section titled “isEnabled()”isEnabled(): boolean;Check whether debug mode is currently enabled.
Returns
Section titled “Returns”boolean
true if debug mode is on.
liveMode()
Section titled “liveMode()”liveMode(uri?): void;Mark the current session as a live (non-practice) presentation.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
uri |
string |
'' |
Optional URI or identifier to associate with the event. |
Returns
Section titled “Returns”void
practiceMode()
Section titled “practiceMode()”practiceMode(uri?): void;Mark the current session as a practice presentation.
Parameters
Section titled “Parameters”| Parameter | Type | Default value | Description |
|---|---|---|---|
uri |
string |
'' |
Optional URI or identifier to associate with the event. |
Returns
Section titled “Returns”void
getSdkLogs()
Section titled “getSdkLogs()”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).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
filter? |
SDKLogFilter |
Optional filter by level, domain, function, date range, retries, and limit. |
Returns
Section titled “Returns”Promise<SDKLogEntry[]>
Array of SDKLogEntry objects, newest first.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
Example
Section titled “Example”const errors = await mobilelocker.log.getSdkLogs({ level: 'error', domain: 'crm' })searchSdkLogs()
Section titled “searchSdkLogs()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text |
string |
The search string. |
filter? |
SDKLogFilter |
Optional pre-filter applied before the text search. |
Returns
Section titled “Returns”Promise<SDKLogEntry[]>
Array of matching SDKLogEntry objects.
Throws
Section titled “Throws”MobileLockerError on network failure or server error.
debug()
Section titled “debug()”debug(message, metadata?): void;Write a debug-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void
info()
Section titled “info()”info(message, metadata?): void;Write an info-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void
Example
Section titled “Example”mobilelocker.log.info('User selected product', { productId: 42, slide: 'overview' })warn()
Section titled “warn()”warn(message, metadata?): void;Write a warn-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void
error()
Section titled “error()”error(message, metadata?): void;Write an error-level log entry into the SDK log store.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message |
string |
Human-readable description of the event. |
metadata? |
Record<string, unknown> |
Optional key/value data to attach to the entry. |
Returns
Section titled “Returns”void