import { environment } from '../../environments/environment';

// Lightweight logger implementation for both dev and production
// Avoids dynamic require() which causes build issues
const createLoggerImpl = (name: string) => ({
  info: (...args: any[]) => {
    if (!environment.production) {
      console.log(`[${name}]`, ...args);
    }
  },
  warn: (...args: any[]) => console.warn(`[${name}]`, ...args),
  error: (...args: any[]) => console.error(`[${name}]`, ...args),
  debug: (...args: any[]) => {
    if (!environment.production) {
      console.debug(`[${name}]`, ...args);
    }
  },
  trace: (...args: any[]) => {
    if (!environment.production) {
      console.trace(`[${name}]`, ...args);
    }
  }
});

export const createLogger = createLoggerImpl;
