DefaultColorTable

public struct DefaultColorTable: ColorTable

A default implementation of the ColorTable protocol.

  • A light gray Color (#999999) used as the foreground color for the .verbose severity.

    Declaration

    Swift

    public static let verboseColor  = Color(r: 0x99, g: 0x99, b: 0x99)
  • A dark gray Color (#666666) used as the foreground color for the .debug severity.

    Declaration

    Swift

    public static let debugColor    = Color(r: 0x66, g: 0x66, b: 0x66)
  • A blue Color (#0000CC) used as the foreground color for the .info severity.

    Declaration

    Swift

    public static let infoColor     = Color(r: 0x00, g: 0x00, b: 0xCC)
  • An orange Color (#DD7722) used as the foreground color for the .warning severity.

    Declaration

    Swift

    public static let warningColor  = Color(r: 0xDD, g: 0x77, b: 0x22)
  • A red Color (#CC0000) used as the foreground color for the .error severity.

    Declaration

    Swift

    public static let errorColor    = Color(r: 0xCC, g: 0x00, b: 0x00)
  • The constructor.

    Declaration

    Swift

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

    Declaration

    Swift

    public 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.