Module Pretty

Functions for pretty ascii output (colors, etc.)

By default a set of tags are added to stdout and stderr. To activate them call Format.pp_set_tags fmt true. Colors can be added to another formatter with the function add_colors.

Tags must be added to the format string with @{<tag> what you want@}. They can be arbitrarily nested. For instance to print a string in red with part of it bold do

Format.printf "@{<red>I'm red. @{<b> I'm bold red.@}@}"

The font tags available are:

The color (foreground) tags are:

And their bright version

The background color tags are:

And their bright version

author
Alain Mebsout

Pretty colors

val vt_width : int

Width of the virtual terminal (80 if cannot be detected)

val print_line : Stdlib.Format.formatter -> unit -> unit

prints separating line

val print_double_line : Stdlib.Format.formatter -> unit -> unit

prints separating double line

val add_colors : Stdlib.Format.formatter -> unit

add color tags to a formatter

Event tags

val timeout_tag : Stdlib.Format.formatter -> unit

Timeout tag.

val success_tag : Stdlib.Format.formatter -> unit

Success tag.

val failure_tag : Stdlib.Format.formatter -> unit

Failure tag.

val error_tag : Stdlib.Format.formatter -> unit

Error tag.

val warning_tag : Stdlib.Format.formatter -> unit

Warning tag.

val note_tag : Stdlib.Format.formatter -> unit

Note tag.

val interruption_tag : Stdlib.Format.formatter -> unit

Interruption tag.

val done_tag : Stdlib.Format.formatter -> unit

Done tag.

val tag_of_level : Stdlib.Format.formatter -> Lib.log_level -> unit