// Dev-only structured logger. Emits prefix-tagged `console.log` lines so
// `scripts/dev/tail-logs.sh` can demultiplex a single Metro stdout
// stream into per-category files via `awk '/^\[net\]/'` etc. Production
// is silent: every call short-circuits on `__DEV__ === false` before
// touching `console`.
//
// The prefix vocabulary mirrors the watch-side `DebugRecorder.Kind`
// categories so a defect can be traced left-to-right across both log
// universes (phone-side `wc.log` + watch-side `watch-app.log` filtered
// on `category == "wc"`).

const enabled = __DEV__

function emit(category: string, args: unknown[]): void {
  if (!enabled) return
  console.log(`[${category}]`, ...args)
}

export const devlog = {
  net: (...args: unknown[]) => emit('net', args),
  wc: (...args: unknown[]) => emit('wc', args),
  auth: (...args: unknown[]) => emit('auth', args),
  push: (...args: unknown[]) => emit('push', args),
}
