Logging

Logs are disabled by default. If you're debugging an application, set the logger option to true.

new HolyheldSDK({
  apiKey: process.env.HOLYHELD_SDK_API_KEY,
  logger: true,
})

You may also set a custom logger:

new HolyheldSDK({
  apiKey: process.env.HOLYHELD_SDK_API_KEY,
  logger: (level, message, data) => {
    console.log(level, message, data);
  },
})

Types:

enum LogLevel {
  Warning = 'warning',
  Log = 'log',
  Info = 'info',
  Debug = 'debug',
}

type Logger = (
  // level of event to be logged
  level: LogLevel,
  // message to be logged
  message: string,
  // optional structured payload to be logged
  data?: { [key: string]: any },
) => void;