TextColorizer

public protocol TextColorizer

TextColorizers are used to apply color formatting to log messages.

  • Applies the specified foreground and background Colors to the passed-in string.

    Declaration

    Swift

    func colorize(_ str: String, foreground: Color?, background: Color?) -> String

    Parameters

    string

    The string to be colorized.

    foreground

    An optional foreground color to apply to string.

    background

    An optional background color to apply to string.

    Return Value

    A version of string with the appropriate color formatting applied.