VernLLMVernLLM
Core Features

Pluggable Logger

Swap in your own logger implementation

VernLLM accepts a custom logger through the logger option. The logger must implement the Logger interface.

import type { Logger } from 'vern-llm';

const pinoLogger: Logger = {
  debug: (msg) => logger.debug(msg),
  warn: (msg) => logger.warn(msg),
  error: (msg, meta) => logger.error(meta, msg),
};

const llm = new VernLLM({
  client: openai,
  model: 'gpt-4o',
  logger: pinoLogger,
});

Default logger behavior

If no logger is provided, VernLLM uses a console-based logger.

debug messages are controlled by the debug option:

  • debug: true enables debug logging.
  • debug: false disables debug logging.
  • When debug is not provided, debug logging is enabled when NODE_ENV !== 'production'.

warn and error messages are always emitted regardless of the debug option.

On this page