/**
 * Safe logger that uses context.logger when available, falls back to console.
 * Avoids direct console.* calls that trigger the no-console eslint rule.
 */

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AnyContext = { logger?: { warn: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void } };

const fallback = console;

export function getLogger(context: AnyContext) {
  return context.logger || fallback;
}
