force_colour

Function force_colour 

Source
pub fn force_colour() -> Result<(), AlreadySet>
Expand description

Inject ANSI colour escape codes into the output, regardless of the value of the NO_COLOR environment variable, or whether the output terminal (if any) supports them.

This should normally only be called by a binary application, not a library. It should be called before using any of the print or write macros.

ยงErrors

Returns an error if this library has already been initialised to not inject ANSI colour escape codes, e.g. by calling force_no_colour of calling one of the macros where the environment was detected to require no coloured output.