Skip to content
FutureBlitz

    Install

    Import std.log.level

    std.log.level

    LogLevel, how much a log line matters, and LogFilter, the least level written for each module, as FB_LOG's text sets it: "debug" for every module, or "info,net=trace,net.http=off", a level for every module and one for each module named.

    std/log/level.fb

    Types

    LogLevel enum

    Public Enum LogLevel

    How much a line matters, the least first.

    std/log/level.fb, line 13

    • TRACE enum member #

      Each step, for following what a program does.

    • DEBUG enum member #

      What helps find a bug.

    • INFO enum member #

      What a program did, as it goes.

    • WARN enum member #

      Something that may be wrong.

    • ERROR enum member #

      Something that went wrong.

    • OFF enum member #

      For a filter: nothing is written.

    LogFilter struct

    Public Struct LogFilter Implements Printable

    The least level written for each module: its own, when it has one, or the nearest module's it's in, so "net.http.client" has "net.http"'s or else "net"'s, or else the base level that every other module has. It's Sendable, so a LogOutput shares it with every thread.

    std/log/level.fb, line 44

    • Public Static Method At(level: LogLevel): LogFilter static method #

      Every module at level.

    • Public Static Method Parse(text: String): LogFilter? static method #

      FB_LOG's text: parts between commas, each a level, which every module gets, or a module, an '=', and its level, with spaces around them left out. Every module is at INFO unless a part says otherwise, and a later part wins. Null when a part is neither, or a module's name is empty.

    • Public Method With(module: String, level: LogLevel): LogFilter method #

      The same filter, with module, and the modules in it that have no level of their own, at level.

    • Public Property Level: LogLevel property #

      The level every module without one of its own has.

    • Public Method LevelOf(module: String): LogLevel method #

      The least level written for module: its own, or the nearest module's it's in, or the base.

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

      Whether a line at level, which isn't OFF, is written for module.

    • Public Method ToString(): String method #

      As FB_LOG's text has it, its modules by name: "info,net=trace".

    Functions

    ParseLogLevel function

    Public Function ParseLogLevel(text: String): LogLevel?

    The level a name says, in any letter case: "trace", "debug", "info", "warn" or "warning", "error", or "off". Null for anything else.

    std/log/level.fb, line 30

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