Repository navigation
Logging
How to get a log off the Vita, and what the build profiles change.
Production (./tools/build.sh) |
Testing (--env testing) |
|
|---|---|---|
| Env file | .env.prod |
.env.testing |
| Log level | errors only | verbose |
| Written by default | no (VITARPS5_LOG_ENABLED=false, VITARPS5_FORCE_ERROR_LOGGING=false) |
yes |
| Queue depth | 64 | 512 |
| Log file name | vitarps5.log |
vitarps5-testing.log |
[logging] in chiaki.toml honoured |
no | yes |
For anything you want to report or compare, build with ./tools/build.sh --env testing. In a production build you can also turn on the in-app Enable Logging switch (saved as enable_logging in Configuration). It switches on verbose logging for that session and writes to the build's log file, vitarps5.log. Testing builds are still the better choice for reports.
| Variable | Meaning |
|---|---|
VITARPS5_LOG_PROFILE |
off, errors, standard or verbose. Anything else means standard. |
VITARPS5_LOG_ENABLED |
true/false: write non-error lines by default. |
VITARPS5_FORCE_ERROR_LOGGING |
true/false: write error lines even when logging is off. |
VITARPS5_LOG_QUEUE_DEPTH |
Whole number; size of the queue between the app and the log-writing thread. |
VITARPS5_LOG_PATH |
Log path on the Vita. |
VITARPS5_ALLOW_RUNTIME_LOGGING_CONFIG |
true lets chiaki.toml override the above on the device. Defaults to off. |
VITARPS5_DEBUG_MENU |
1 enables the hidden debug palette (testing profile sets it). |
Source: tools/build.sh (configure_logging_cmake_args), vita/src/logging.c.
In ux0:data/vita-chiaki/chiaki.toml:
[logging]
enabled = true
force_error_logging = true
profile = "verbose" # off | errors | standard | verbose
path = "ux0:data/vita-chiaki/vitarps5-testing.log"
queue_depth = 512queue_depth is kept between the build's own value and 1024. You can raise it but not go below what the build was compiled with, so an old config file cannot silently shrink the queue.
ux0:data/vita-chiaki/. Each run writes a new file whose name starts with a number (the Vita's clock in microseconds) in front of the configured name, for example 106337776412_vitarps5-testing.log. The first lines show the build: look for [PIPE/BUILD] commit=... branch=... dirty=... so you know which build made the log.
- Start the FTP server in VitaShell (SELECT).
- Download the file, for example:
curl -O "ftp://<vita_ip>:1337/ux0:/data/vita-chiaki/<file name>"or browse toux0:/data/vita-chiaki/in an FTP client or over USB from VitaShell.
Always use grep -a. The files contain bytes that make BSD/macOS grep treat them as binary, and it then prints nothing at all, with no warning.
grep -a "PIPE/FPS" 106337776412_vitarps5-testing.logMissing lines. Logs from builds before PR #250 could silently drop their oldest lines when the app logged faster than the file could be written, and nothing in the file said so. In those logs, "I do not see line X" proves nothing.
Current builds count the loss and write a summary line at most once a second:
LOG_LINES_DROPPED overflow=<n> contention=<n> span_ms=<n> total_overflow=<n>
-
overflow: lines that were queued and then pushed out because the queue was full, since the last summary. -
contention: lines that were never queued because the logger was busy. -
span_ms: how long the overflow lasted. -
total_overflow: the whole-session total of overflow (never reset), so it is still correct if an individual summary line was itself lost.
If a log has no LOG_LINES_DROPPED line, no loss was counted. If it has one, treat gaps near its time as loss and ask for the matching test with a larger queue_depth.
Source: vita/src/logging.c (vita_log_submit_line, vita_log_queue_push_locked).