# Protocol: log

The `log` commands a program sends to a running game, as the engine describes them: what each takes, what it answers and what it does. Back to [all commands](../protocol-commands.md).

## log.since

`log.since {step?: integer, after?: integer} -> {step: integer, from: integer, made: integer, lines: [record]}` · read, read-only

Reads what the game said in every step after a given one: the lines its scripts printed, each with the file and line of the `print`, and the warnings game.info lists, each once when it first appears. Scripts print to standard error, which a client does not read; this is the same text. Lines printed by a script the debugger holds stopped are there at once, so a client that polls while stopped passes `after`. The log is of one line of time: game.reset starts it again, empty, and it keeps the latest 4096 lines.

| Parameters | Type | Meaning |
| --- | --- | --- |
| `step?` | integer | Lines of steps after this one are returned: pass the step of the last answer you had. Left out: every line the log keeps, those the scripts printed while loading (step 0) among them. |
| `after?` | integer | Only lines whose `n` is greater: pass the `made` of the last answer you had to get each line once, whatever the step. When `made` comes back smaller than the one you hold, the game was loaded again: start from 0. |

| Result | Type | Meaning |
| --- | --- | --- |
| `step` | integer | How many fixed steps have run. |
| `from` | integer | The step the answer starts after: the one asked for (0 when none was), or a later one when the log does not go back that far. |
| `made` | integer | How many lines the game has said since it was loaded: the `n` of the newest. |
| `lines` | [record] | One {n, step, kind, file, line, text} per line, in the order said. n counts the lines from 1. step is how many steps had run when the step that said it ended. kind is "print" or "warning". file and line are where the `print` was called, a script or a library of the game; null for a warning. |
