FsMake


Console Module

Module for writing to the console.

Types

Type Description

Color

Console colors.

IWriter

An abstraction for different types of console writers.

Level

The level of a console message.

Message

A message to write the console.

OutputType

The output of the console writer.

TextPart

Represents text that makes up a message.

Verbosity

The verbosity of a console writer.

Functions and values

Function or value Description

append text message

Full Usage: append text message

Parameters:
    text : string - The text to append.
    message : Message - The message to append the text to.

Returns: Message The updated message.

Append text to a message.

text : string

The text to append.

message : Message

The message to append the text to.

Returns: Message

The updated message.

appendColor color text message

Full Usage: appendColor color text message

Parameters:
    color : Color - The color of the text.
    text : string - The text to append.
    message : Message - The message to append the colored text to.

Returns: Message The updated message.

Appends colorized text to a message.

color : Color

The color of the text.

text : string

The text to append.

message : Message

The message to append the colored text to.

Returns: Message

The updated message.

appendPart textPart message

Full Usage: appendPart textPart message

Parameters:
    textPart : TextPart - The part to append.
    message : Message - The message to append the part to.

Returns: Message The updated message.

Appends a TextPart to a message.

textPart : TextPart

The part to append.

message : Message

The message to append the part to.

Returns: Message

The updated message.

Example

 let msg =
     Console.Info
     |> Console.message "Hello "
     |> Console.appendPart (Console.Text "world!")

appendParts textParts message

Full Usage: appendParts textParts message

Parameters:
    textParts : TextPart list - The parts to append.
    message : Message - The message to append the parts to.

Returns: Message The updated message.

Appends TextParts to a message.

textParts : TextPart list

The parts to append.

message : Message

The message to append the parts to.

Returns: Message

The updated message.

Example

 let msg =
     Console.Info
     |> Console.message "Hello "
     |> Console.appendParts [ Console.Text "world!" ]

appendToken text message

Full Usage: appendToken text message

Parameters:
    text : string - The token text.
    message : Message - The message to append the token to.

Returns: Message The updated message.

Appends a token to a message.

text : string

The token text.

message : Message

The message to append the token to.

Returns: Message

The updated message.

createWriter outputType verbosity

Full Usage: createWriter outputType verbosity

Parameters:
Returns: IWriter The new IWriter.

Creates a IWriter.

outputType : OutputType

The OutputType of the console.

verbosity : Verbosity

The Verbosity of the console.

Returns: IWriter

The new IWriter.

error text

Full Usage: error text

Parameters:
    text : string - The error text.

Returns: Message The new message.

Creates an error status message.

text : string

The error text.

Returns: Message

The new message.

errorColor

Full Usage: errorColor

Returns: Color

The error status message Color.

Returns: Color

info text

Full Usage: info text

Parameters:
    text : string - The info text.

Returns: Message The new message.

Creates an info status message.

text : string

The info text.

Returns: Message

The new message.

infoColor

Full Usage: infoColor

Returns: Color

The info status message Color.

Returns: Color

message text level

Full Usage: message text level

Parameters:
    text : string - The message text.
    level : Level - The level of the message.

Returns: Message The new message.

Creates a message with text.

text : string

The message text.

level : Level

The level of the message.

Returns: Message

The new message.

messageColor color text level

Full Usage: messageColor color text level

Parameters:
    color : Color - The color of the text.
    text : string - The message text.
    level : Level - The level of the message.

Returns: Message The new message.

Creates a message with colorized text.

color : Color

The color of the text.

text : string

The message text.

level : Level

The level of the message.

Returns: Message

The new message.

messageEmpty tokenColor level

Full Usage: messageEmpty tokenColor level

Parameters:
    tokenColor : Color - The color of TextPart tokens in the message.
    level : Level - The level of the message.

Returns: Message The new message.

Creates an empty Message.

tokenColor : Color

The color of TextPart tokens in the message.

level : Level

The level of the message.

Returns: Message

The new message.

messageParts tokenColor textParts level

Full Usage: messageParts tokenColor textParts level

Parameters:
    tokenColor : Color - The color of TextPart tokens in the message.
    textParts : TextPart list - The list of parts that make up message.
    level : Level - The level of the message.

Returns: Message The new message.

Creates a Message from the given parts.

tokenColor : Color

The color of TextPart tokens in the message.

textParts : TextPart list

The list of parts that make up message.

level : Level

The level of the message.

Returns: Message

The new message.

Example

 let msg =
     Console.Info
     |> Console.messageParts
         Console.infoColor
         [ Console.Text "Hello "
           Console.Colorized ("world!", Console.Yellow) ]

prefix prefix message

Full Usage: prefix prefix message

Parameters:
    prefix : TextPart - Prefix for the beginning of the message.
    message : Message - The message to set the prefix on.

Returns: Message The updated message.

Sets a message prefix.

prefix : TextPart

Prefix for the beginning of the message.

message : Message

The message to set the prefix on.

Returns: Message

The updated message.

statusMessage color text level

Full Usage: statusMessage color text level

Parameters:
    color : Color - The color of tokens in the message.
    text : string - The message text.
    level : Level - The level of the message.

Returns: Message The new message.

Creates a status message.

color : Color

The color of tokens in the message.

text : string

The message text.

level : Level

The level of the message.

Returns: Message

The new message.

success text

Full Usage: success text

Parameters:
    text : string - The success text.

Returns: Message The new message.

Creates a success status message.

text : string

The success text.

Returns: Message

The new message.

successColor

Full Usage: successColor

Returns: Color

The success status message Color.

Returns: Color

warn text

Full Usage: warn text

Parameters:
    text : string - The warning text.

Returns: Message The new message.

Creates a warning status message.

text : string

The warning text.

Returns: Message

The new message.

warnColor

Full Usage: warnColor

Returns: Color

The warn status message Color.

Returns: Color