Skip to main content

Module syslog

Module syslog 

Source
Expand description

iph syslog: the phone’s log stream, kept in the daemon while a test runs, so what an app logged after a tap can be read back.

One capture per daemon. The stream is read by a task of its own that never touches the session, so commands keep working while it runs. An entry that passes the filters goes into a ring buffer bounded by entry count and by bytes and gets a seq (1 for the first). read returns what is newer than a seq the caller already has and says where to continue; the buffer goes with the capture. With output the kept entries are also written to a JSON Lines file: a start line, the entries, and an end line that says why the capture ended. A file without an end line belongs to a daemon that was killed.

Structs§

AppBundle
An installed app, by where it lives on the phone.
Capture
Entry
One log entry as it is kept. Its seq belongs to the buffer, not to it.
FileSpec
Filter
What is kept on this side. A pid is filtered by the phone instead.
Limits
Live
What the reading task and the session share.
Page
One read: the matching entries oldest first and where to go on.
Query
Ring
The kept entries, newest last. Their seqs run without a gap from first_seq to newest_seq, since only the oldest are evicted, so a seq finds its entry by position.
Sink
The file, kept under a size: once the next line would pass it, the file becomes <file>.1 (replacing an older one) and a new file starts.
Spec

Enums§

Level
Severity, lowest first. The device’s own codes are not in this order.
Request

Functions§

parse
Parse the arguments every surface sends. A given output must be absolute, since the daemon writes it.
rotated
Where the previous part goes when the file reaches its size.