## Debugging Pong
The primary method here to understand what Pong is doing (or indeed any other
program you choose to turn this repo into) is the log. To emit objects to the
log, use the `log` function:
```
log(2, "log message")
```
`log` takes exactly 2 arguments: a stack frame index to report the file and
line number for, and an object to log.
The stack frame index should be `2` if you call `log` directly. If you create
higher levels of abstraction around `log`, increment the stack frame
appropriately. Helper `f` calling `log` should use a stack frame index of `3`
to report line numbers from its caller. Helper `g` calling `f` calling `log`
should use a stack frame index of `4`, and so on.
The `log` function can only emit a single object at a time. However, the
object can be of any type.
Since each entry/line in the log contains a single object (after the filename
and line number), it's easy to specify how different objects should be
rendered. Just make sure the objects contain a field called `name`, and create
a function `debug_log_render.name` to render it. In this repo, the function
`debug_log_render.state` is an example of such a function, specifying how to
render a Pong state consisting of a ball position, ball velocity and paddle
positions.
Rendering functions must all have the same interface as
`debug_log_render.state`:
```
function debug_log_render.state(state, x,y, w)
...
end
```