let showDebug = process.env.DEBUG ?? false
let showInfo = true

export function setLogLevel(level: "debug" | "info" | "error") {
  showDebug = level === "debug"
  showInfo = level === "debug" || level === "info"
}

const log = (...args: any[]) => {
  if (showInfo) console.log("👁️‍🗨️ INFO: ", ...args)
}

log.debug = (...args: any[]) => {
  if (showDebug) console.debug("🪲 DEBUG: ", ...args)
}

log.error = (...args: any[]) => {
  console.error("💥 ERROR: ", ...args)
}

export default log
