Skip to content
FutureBlitz

    Install

    Import std.log.sinks

    LogLine

    std.log.sinks

    function

    Public Function LogLine(record: LogRecord, times: Bool = True, colors: Bool = False): String

    The line as the console's sink writes it: its time in UTC, to the millisecond, its level, its module, its message, and its fields, as name=value, where a name or a value with a space, a quote, an '=', or a control character, or none, is quoted, as JSON quotes it: "2026-10-24T04:12:00.123Z INFO net.http: connected host=example.com port=443". The message's control characters but a tab are escaped as JSON escapes them, so a line stays one line.

    Examples

    Local record = LogRecord(Timestamp.Now(), LogLevel.WARN, "net", "slow reply")
    Local line = LogLine(record, False)
    Expect(line.StartsWith("WARN") && line.Contains("net: slow reply"))
    Expect(JsonLine(record).Contains("\"level\":\"warn\""))

    std/log/sinks.fb, line 57

    Report an issue with this page or with FutureBlitz on GitHub.