XcodeColorsTextColorizer
public struct XcodeColorsTextColorizer: TextColorizer
A TextColorizer
implementation that applies
XcodeColors-compatible
formatting to log messages.
-
Initializes a new instance if and only if XcodeColors is installed and enabled, as indicated by the presence of the
XcodeColors
environment variable. (Unless the value of this variable is the stringYES
, this initializer will fail.)Declaration
Swift
public init?()
-
Applies XcodeColors-style formatting appropriate for the given
LogSeverity
to the passed-in string.Declaration
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.