Import std.log.output
std.log.output
What a Logger writes, and where: a LogRecord, with its LogFields, for each line, given to each sink of a LogOutput whose filter writes it.
std/log/output.fb
Types
LogField
struct
Public Struct LogField
One of a line's fields: its name and the text of its value, which a JSON line quotes when it's text, and writes as it is when it's a number or a Bool.
-
The field's name.
-
The text of its value.
-
Whether its value is text, which a JSON line quotes, rather than a number or a Bool.
-
A field
nameoftext, which is a number's or a Bool's whenisTextis False.
LogRecord
struct
Public Struct LogRecord
A line, as a Logger gives it to its output's sinks.
-
When it was written.
-
How much it matters.
-
The module of the Logger that wrote it.
-
What it says.
-
Its fields, the Logger's and its own.
-
A line of
message, atlevel, frommodule, attime, without fields. -
Public New(time: Timestamp, level: LogLevel, module: String, message: String, fields: ImmutableArray<LogField>)constructor #A line of
message, atlevel, frommodule, attime, withfields.
LogOutput
class
Public Shared Class LogOutput
Where Loggers' lines go: to each of its sinks, in the order they were added, once its filter writes the line's level for its module. Each sink gets the lines of every thread that logs, at once, so it must take them at once, as the console's does.
-
An output with no sinks, whose filter is
filter. -
Adds
sink, which each line written after this goes to, after the sinks added before it. -
Takes every sink out, so lines go nowhere until one is added.
-
The filter, which says what's written, or a new one, which the lines logged after it go by.
-
Whether its filter writes a line at
levelformodule. -
Gives
recordto each sink, if its filter writes it. The sinks are called outside the lock, so one can log, or add a sink, which the next line goes to.
Report an issue with this page or with FutureBlitz on GitHub.