Skip to main content

Module logs

Module logs 

Source
Expand description

Task logs, read from the worker that ran the attempt (see archive/PROJECT.md, Task logs): the webserver proxies them, so clients never reach workers.

A worker’s address is what it advertised when it registered (workers.log_endpoint), so it is found by the worker’s ID. Every answer names the worker that gave it (Schedr-Worker-Id): an address that now belongs to another worker is noticed instead of passing for a deleted log. Requests to workers never go through an HTTP proxy, and in tls.mode = "app" present the webserver’s certificate and expect the worker’s to name [tls] worker_name.

Structs§

HttpLogSource
Logs from workers over HTTP (TLS in app mode), never through a proxy.
MaskedPart
A part of a log as shown: masked, whole lines only.
WorkerLog
A part of a log, as a worker gave it.

Enums§

LogFetchError
Why a worker gave no log.

Constants§

CONNECT_TIMEOUT
How long connecting to a worker may take.
REQUEST_TIMEOUT
How long a whole request to a worker may take.

Traits§

LogSource
Where the webserver gets logs from (workers over HTTP; something else in tests).

Functions§

masked_lines
bytes, a part of a log, as shown: masked (a task may print an address with its password), whole lines only, so no secret is shown in pieces (a reader picks where a part starts and how long it is). Not starting a line (at_line false), it starts after its first newline, all of it skipped when it has none. With more to come, it ends after its last newline, the rest left for the next part. With none in it, it waits for its line’s end, unless it is full (as long as asked) and starts a line: then it is shown to its last whitespace (its last token may go on), ending with a note that it is cut, and the rest of that line is skipped, as a part not starting a line is. A short part shows a line’s start at most, never its pieces. before, the bytes just before the part, is masked with it, not shown: a value begun there (a quoted one going on over lines) is hidden in the part too.
text_of
bytes as text, and how many of them it covers: a character cut at the end (more of the log follows) is left for the next part, so following a log never garbles one; invalid bytes become U+FFFD.

Type Aliases§

LogFuture
The future of a LogSource::fetch.