ColorTable

public protocol ColorTable

ColorTables are used to supply foreground and background Color values for a given LogSeverity.

  • Returns the foreground color to use (if any) for colorizing messages at the given LogSeverity.

    Declaration

    Swift

    func foreground(forSeverity severity: LogSeverity) -> Color?

    Parameters

    severity

    The LogSeverity whose color information is being retrieved.

    Return Value

    The foreground Color to use for severity, or nil if no color is specified.

  • background(forSeverity:) Default implementation

    Returns the background color to use (if any) for colorizing messages at the given LogSeverity.

    Default Implementation

    A default function implementation to always return nil indicating that no background color information is specified. By default, ColorTable implementations only supply foreground color information.

    Declaration

    Swift

    func background(forSeverity severity: LogSeverity) -> Color?

    Parameters

    severity

    The LogSeverity whose color information is being retrieved.

    Return Value

    The background Color to use for severity, or nil if no color is specified.