fpm_backend_console Module

Build Backend Console

This module provides a lightweight implementation for printing to the console and updating previously-printed console lines. It used by [[fpm_backend_output]] for pretty-printing build status and progress.

@note Note The implementation for updating previous lines relies on no other output going to stdout/stderr except through the console_t object provided.

@note Note All write statements to stdout are enclosed within OpenMP critical regions



Variables

Type Visibility Attributes Name Initial
character(len=*), public, parameter :: COLOR_GREEN = ESC//"[32m"

Escape code for green foreground color

character(len=*), public, parameter :: COLOR_RED = ESC//"[31m"

Escape code for red foreground color

character(len=*), public, parameter :: COLOR_RESET = ESC//"[0m"

Escape code to reset foreground color

character(len=*), public, parameter :: COLOR_YELLOW = ESC//"[93m"

Escape code for yellow foreground color

character(len=*), public, parameter :: LINE_RESET = ESC//"[2K"//ESC//"[1G"

Escape code for erasing current line


Derived Types

type, public ::  console_t

Console object

Components

Type Visibility Attributes Name Initial
integer, public :: n_line = 1

Number of lines printed

Type-Bound Procedures

procedure, public :: update_line => console_update_line ../../

Update a previously-written console line

procedure, public :: write_line => console_write_line ../../

Write a single line to the console