Appo

Logging

Observe bridge activity with the setLogger callback.

The SDK produces no console output by default. Use setLogger to observe bridge activity.

Setup

import { setLogger } from '@appolabs/appo';

setLogger((level, message, data) => {
  // level: 'debug' | 'warn' | 'error'
  console.log(`[appo:${level}]`, message, data);
});

Disable Logging

setLogger(null);

Log Events

LevelEventDescription
debugSending messageA bridge message is being sent to the native layer
debugReceived responseA response was received for a pending request
debugReceived eventAn event broadcast was received from the native layer
warnRequest timed outThe native layer did not respond within the timeout
warnFailed to parse messageAn incoming message could not be parsed as JSON
warnInvalid message structureA message was received that is neither a response nor an event

Payloads are excluded from log data to prevent leaking sensitive information. The data parameter contains metadata like message IDs and types.

On this page