5. Set up a debug logger

Wallet SDK includes verbose logging which can be helpful for debugging. These logs are suppressed by default but can be forwarded to any logging implementation you desire.

Example: Add console logging/errors for Wallet SDK:

// main.ts
...
import {
  ...
  setLoggers
} from '@railgun-community/wallet';

const setEngineLoggers = () => {
  const logMessage: Optional<(msg: any) => void> = console.log;
  const logError: Optional<(err: any) => void> = console.error;

  setLoggers(logMessage, logError);
}

// App launch
try {
  initializeEngine();
  ...
  setEngineLoggers();
  ...
} catch (err) {
  // Handle err
}

Consider enabling shouldDebug during Engine initialization for deeper debug logs in the RAILGUN Privacy Engine.

Last updated