const lines: string[] = []

export function gameLog(msg: string) {
  const t = ((performance.now() / 1000) | 0).toString().padStart(4, '0')
  const line = `[${t}s] ${msg}`
  lines.push(line)
  console.log(line)
}

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

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