import { usePreferencesStore } from '../stores/preferences-store'

/**
 * Gated console.log - only emits when diagnostic logging is enabled in
 * Settings. Use everywhere we used to write `console.log('[JF] ...')`.
 */
export function debugLog(...args: unknown[]): void {
  try {
    if (usePreferencesStore.getState().diagnosticLogging) {
      console.log(...args)
    }
  } catch {
    /* noop */
  }
}
