// src/logger.ts
var NOOP_LOGGER = {
  info() {
  },
  warn() {
  },
  error() {
  },
  debug() {
  }
};
var _backend = NOOP_LOGGER;
var _debug = false;
var CONSOLE_LOGGER = {
  info: console.info.bind(console),
  warn: console.warn.bind(console),
  error: console.error.bind(console),
  debug: console.debug.bind(console)
};
function initLogger(backend, debug) {
  _backend = backend ?? CONSOLE_LOGGER;
  _debug = debug ?? false;
}
var log = {
  info(msg, ...args) {
    _backend.info(`remnic: ${msg}`, ...args);
  },
  warn(msg, ...args) {
    _backend.warn(`remnic: ${msg}`, ...args);
  },
  error(msg, err) {
    const detail = err instanceof Error ? err.message : err ? String(err) : "";
    _backend.error(
      `remnic: ${msg}${detail ? ` \u2014 ${detail}` : ""}`
    );
  },
  debug(msg, ...args) {
    if (!_debug) return;
    const fn = _backend.debug ?? _backend.info;
    fn(`remnic [debug]: ${msg}`, ...args);
  }
};

export {
  initLogger,
  log
};
//# sourceMappingURL=chunk-2ODBA7MQ.js.map