const shouldLog = import.meta.env.DEV || import.meta.env.VITE_ENABLE_LOGS === 'true'

type LogArgs = Parameters<typeof console.log>

export const logger = {
  debug: (...args: LogArgs) => {
    if (shouldLog) {
      console.debug(...args)
    }
  },
  info: (...args: LogArgs) => {
    if (shouldLog) {
      console.info(...args)
    }
  },
  warn: (...args: LogArgs) => {
    if (shouldLog) {
      console.warn(...args)
    }
  },
  error: (...args: LogArgs) => {
    if (shouldLog) {
      console.error(...args)
    }
  }
}
