Home > @magiclane/maps-sdk > Debug

Debug class

Provides debugging utilities for memory monitoring, logging, and SDK configuration.

The Debug class offers static methods for monitoring memory usage, controlling log output, configuring routing and navigation behavior, and retrieving SDK diagnostics. Key features include:

Settings

Signature:

export declare abstract class Debug 

Properties

Property

Modifiers

Type

Description

appIOInfo

static

readonly

any[]

Get app I/O information including mount points and disk usage.

freeMemory

static

readonly

number

Returns the free system memory including swap and kernel cache.

isMainThread

static

readonly

boolean

Check if the current thread is the main thread.

isObjectAliveCheckEnabled

static

boolean

If enabled checks if an object is alive before calling a method on it. Used for debugging purposes.

logCallObjectMethod

static

boolean

If enabled prints method object calls JSONs to the console. Used for debugging purposes.

logCreateObject

static

boolean

If enabled prints create object calls JSONs to the console. Used for debugging purposes.

logListenerMethod

static

boolean

If enabled prints listener messages JSONs to the console. Used for debugging purposes.

mapViewMaxZoomRanges

static

readonly

number

Retrieve the maximum zoom ranges allowed on a MapView.

maxUsedMemory

static

readonly

number

Returns the maximum memory used by the SDK engine since initialization.

Useful for profiling and identifying peak memory consumption during testing.

navigationModifiers

static

readonly

Set<NavigationModifiers>

Retrieve the current navigation location modifiers.

rawPositionTrackerEnabled

static

readonly

boolean

Check if raw position tracker is enabled.

sdkLogDumpPath

static

readonly

Promise<string>

Retrieves the file path to the SDK crash report log.

The log file contains detailed information about SDK operations and is automatically sent to Magic Lane servers in case of crashes. Custom entries can be added using log, and verbosity is controlled via setSdkDumpLevel.

servicesIds

static

readonly

number[]

Retrieve a list of service IDs used within the application.

timeToBetterRoute

static

readonly

number

Get the remaining time in seconds until the next check for a better route.

timeToCheckTrafficAlongRoutes

static

readonly

number

Get the remaining time in seconds until the next check for traffic conditions along all routes.

totalMemory

static

readonly

number

Returns the total system memory available to the device.

usedMemory

static

readonly

number

Returns the memory currently used by the SDK engine.

Useful for monitoring memory consumption and detecting potential memory leaks during development.

Methods

Method

Modifiers

Description

checkBetterRoute()

static

Initiate a check for a better route.

checkTrafficAlongRoutes()

static

Initiate a check for traffic conditions along all routes.

getServiceName(id)

static

Retrieve the name of a service given its ID.

log({ level, message, module, functionName, fileName, lineNumber, }, input)

static

Writes a log message to the SDK logging system for crash analysis.

Logs are automatically written to a file and sent to Magic Lane servers in case of crashes. Use setSdkDumpLevel to control the verbosity of logs included in crash reports.

setNavigationModifiers(modifiers)

static

Set modifiers for navigation locations.

setSdkDumpLevel(level)

static

Sets the verbosity level for crash report logs sent to Magic Lane.

On Android, all GemDumpSdkLevel values are supported. On iOS, only silent and verbose are supported—any other value defaults to verbose.