const MAX_LINES = 1000

const lines: string[] = []

export function log(msg: string) {
  lines.push(msg)
  if (lines.length > MAX_LINES) lines.splice(0, lines.length - MAX_LINES)
}

export function getLog(): string {
  return lines.join('\n')
}

export function clearLog() {
  lines.length = 0
}
