std:logging/TextSink
std:logging/TextSink
Section titled “std:logging/TextSink”Canonical occurrence:
protos/lib/logging/TextSink.protos· Protos revision:e99b712ecf658a527b1fe82c8beba2c1286d8dc9.
Sinks that write each event as one line of text to an explicitly supplied
TextWriter. The sink borrows the writer: it never opens, discovers, flushes,
closes, or otherwise takes over the writer’s lifecycle, which stays with the
caller. Logging never looks up standard output, standard error, files,
network endpoints, the Process, or the environment; a caller that wants the
process streams passes, for example, the writer answered by
std:io/ProcessStreams.stdoutWriter(process).
Observable top-level slots
Section titled “Observable top-level slots”This page lists the complete mechanically observable top-level slot inventory required by D067. Authored documentation, when present, is canonical D062 prose; mechanical presence alone does not create a stability or compatibility promise.
Answers a fresh frozen sink that renders each event with
formatter.format(event) and writes the result with
writer.writeLine(text), so the line terminator is the writer’s. Neither
argument may be null; otherwise an Error is signalled.
The sink answers emit(event), which formats event, writes the line, and
waits for the write Future with value() before answering null. A slow
writer therefore suspends the calling Task, and no Task, queue, or buffer is
created. An Error from formatting or from the failed write Future is
signalled by emit; a std:logging/Logger contains it, while a direct
caller of emit observes it.
Mechanical facts
Section titled “Mechanical facts”-
Fixed parameters:
formatter,writer -
Rest parameter: none
-
Source occurrence:
protos/lib/logging/TextSink.protos:35 -
Exact source page: open in the source browser
Exact module source · Standard-library API · Standard library overview