/** * Minimal scoped logger for the React Native app. It is the single sink that * talks to the JS console (Metro / logcat / Xcode), so feature code never * calls `console.*` directly and the output format stays consistent. */ export interface Logger { info: (message: string, ...details: unknown[]) => void; warn: (message: string, ...details: unknown[]) => void; error: (message: string, ...details: unknown[]) => void; } type LogLevel = keyof Logger; type ConsoleSink = Pick; export function createLogger(scope: string, sink: ConsoleSink = console): Logger { const prefix = `[${scope}]`; const write = (level: LogLevel) => (message: string, ...details: unknown[]): void => { sink[level](`${prefix} ${message}`, ...details); }; return { info: write('info'), warn: write('warn'), error: write('error'), }; }