Skip to content
FutureBlitz

    Install

    Import std.log.output

    LogOutput

    std.log.output

    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.

    Examples

    Local output = LogOutput(LogFilter.At(LogLevel.WARN))
    Expect(!output.Allows("app", LogLevel.INFO) && output.Allows("app", LogLevel.ERROR))
    output.Filter = LogFilter.At(LogLevel.DEBUG)
    Expect(output.Allows("app", LogLevel.INFO))
    // A record goes to each sink; with none, it goes nowhere.
    output.Write(LogRecord(Timestamp.Now(), LogLevel.INFO, "app", "quiet"))

    std/log/output.fb, line 90

    • Public New(filter: LogFilter) constructor #

      An output with no sinks, whose filter is filter.

    • Public Method Add(sink: Sendable Func(LogRecord)) method #

      Adds sink, which each line written after this goes to, after the sinks added before it.

    • Public Method Clear() method #

      Takes every sink out, so lines go nowhere until one is added.

    • Public Property Filter: LogFilter property #

      The filter, which says what's written, or a new one, which the lines logged after it go by.

    • Public Method Allows(module: String, level: LogLevel): Bool method #

      Whether its filter writes a line at level for module.

    • Public Method Write(record: LogRecord) method #

      Gives record to 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.