# memlog

> **Tool `tools/live/memlog.py`** (program, The running game). Read a recording made by memrec.py: a summary, a CSV table, or one sample by time.

Run it with `./gameframe run memlog ARGS` or `python3 tools/live/memlog.py`. [Source on GitHub](https://github.com/tanepiper/game-frame/blob/main/tools/live/memlog.py).

## Its own help

This is the help text in the tool itself, as `./gameframe tool memlog` prints it.

```text
Read a recording made by memrec.py: a summary, a CSV table, or one sample by time.

Usage: memlog.py summary FILE
       memlog.py csv FILE [--fields NAME,NAME] [--fixed NAME,NAME] [--out FILE]
       memlog.py at FILE SECONDS

  FILE      a JSON Lines recording: one sample a line, {"t": seconds, "n": sample, NAME: value}
            (tools/live/memrec.py record)
  summary   the samples, the time they span and the rate, then each value: its type, the
            smallest and largest value, and how many times it changed
  csv       a table with one column per value; an array NAME becomes NAME[0], NAME[1] ...
  --fields  only these values (default: all, in the recording's order)
  --fixed   print these values as 16.16 fixed point (value / 65536, six decimals); the
            recording itself keeps the raw integers
  at        the sample nearest to SECONDS, as JSON

Why: a recording is the reference run a port is checked against
(docs/knowhow/record-a-run-from-memory.md). Spreadsheets and plots want CSV; a quick look
wants the ranges, and a stuck or never-changing value shows at once in the summary.

It does not print values the game's own way (a game's time format, say): write that in the
project, beside the port, and test it against the game's screens. Standard library only.
```

## Named by

Skills: [re-observe](/skills/re-observe).
