wingmirror Download
Docs Diagnostics

Docs · The app

Diagnostics

When a tap does nothing, nothing says why. Diagnostics are the app keeping a record of what each touch and each tap came to, so that the reason can be read afterwards. They are off unless you switch them on: Diagnostics ▸ Record Diagnostics in the menu. The panel hears of the switch at once; nothing has to be reloaded. Off, nothing is recorded and none of this code runs.

On, the app adds lines beginning diag to its log, ~/Library/Application Support/Wingmirror/wingmirror.log (Reveal Log in Finder shows it), each one fact on one line:

LineWhat it says
diag touch 07f at 2225,431 to 2225,431, 84 ms, 0 px in 0 moves, lifted, delivered, 2140 ms after the lastOne for each touch, when it ends: a short name for it, where the finger went down and came up in the panel's pixels, how long it lasted, how far it got and in how many moves, how it ended (lifted, lost when the touch controller went away under the finger, cancelled when the app let go of the controller), whether the panel was handed it or why not (the Mac was locked, the panel was hidden, the contact was taken for bounce), and how long after the touch before. flagged: follows when it looks like trouble: short (under 30 ms), long (over 800 ms), travelled (over 12 pixels), lost, cancelled, bounce (within 120 ms of the last), dropped, and second try after 07e when it lands where a touch that came to nothing just did.
diag tap 07f agents: Approve (Bash), 82 ms; ignored: this card moved 240 ms agoWhat the tap landed on and what came of it, with the touch's name. The control is named by a fixed word for what it is, with the tool's name beside a request's buttons. Then what happened: asked: allow, opened the session instead, click, or why nothing did, said by the code that decided it: ignored: this card moved 240 ms ago, ignored: button disabled (not read to the end), ignored: busy, ignored: tail of a move, ignored: settling after a change, no click: down and up on different controls, no click: the card was redrawn under the finger, no click: the touch ended off the panel.
diag action 07f agents: allow act_…3f2a, taken after 38 msWhat was asked of the app for a request and how it answered, with the time it took: taken, or refused: already answered.
diag again 080 agents: Approve (Bash), second try 1656 ms after 07f (ignored: this card moved 449 ms ago)The same control tapped again within three seconds of a tap that came to nothing, and what that first tap came to. This is the line to look for when something took two taps.
diag health touch active, 412 reports, 0 unread; bus 1 stream, 14 hook requests, 0 refused, 4 sessions, 1 waiting; page rail+agents, 2 of 2 ready, online; web 143 MB, app 61 MB; unlocked, lit, on the EdgeOnce a minute: the touch controller, the connections to the app, the widgets loaded, the memory in use, and whether the panel can be seen and pressed.
diag error …, diag device …, diag widget …, diag on …, diag off …An uncaught error in the panel's page or a built-in widget (its kind, a short message with anything quoted taken out, the file and line); the page's process ending; the touch controller changing state; a note from a widget of your own (see docs/widget-authoring.md); and the switch itself.

What is never recorded: a command, a file's path or contents, a project's name, the words of a question or its answers, a page's name, a session's id beyond the four characters the log already uses, or anything typed. A request is known by its tool's name and the last four characters of its id. A note from a widget of your own is that widget's words, cut to 120 characters and marked as its own; it is counted in the report and never quoted there.

Copy Diagnostics Report puts a page of plain text on the clipboard, made from the log and the file before it: the app's version and build, the macOS version, how the app is signed (ad hoc, development or Developer ID), the display, the theme and text size, which agents are connected and when diagnostics were switched on; then, for the last 24 hours, the touches and how many were flagged for what, the taps that came to nothing by reason, the second tries by reason, what was asked and how it was answered with the middle and the worst time, the errors, and the highest and lowest figures of the once-a-minute lines; then the last 40 diag lines as they were written. It says how far back the log goes, since a busy day does not fit in it. Read it through before sending it to anyone.

What it costs: a touch writes one line and a tap one to three, about 400 bytes in all, and the once-a-minute line about 14 KB an hour. The log starts again at 512 KB and keeps the one before, so an hour of steady use does not fill it. Lines from the panel are limited to thirty at once and two a second after that, and the app's own to sixty at once and four a second; what is over is dropped and counted. Nothing is recorded for a finger moving, and nothing is looked at more often than once a second.

A build run from the command line on a spare port records with WINGMIRROR_DIAGNOSTICS=1, writes the lines to the terminal, and to a file as well if WINGMIRROR_LOG_FILE names one. Wingmirror diagnostics report <log file> prints the report made from such a file.

Edit source on GitHub README.md#diagnostics