distillery v2.0.8 Mix.Releases.Shell View Source

This module provides conveniences for writing output to the shell.

Link to this section Summary

Functions

Wraps a message in the given color

Configure the logging verbosity of the release logger

Ask the user to confirm an action using the given message. The confirmation prompt will default to “[Yn]: “, and the regex for determining whether the action was confirmed will default to “^(y(es)?)?$”

Same as confirm/1, but takes a custom prompt and answer regex pattern. If the pattern matches the response, the action is considered confirmed

Write an debug message to standard out

Write a debug level message, but with minimal formatting. Default color is same as debug level

Write an error message to standard out

Prints an error message, then terminates the VM with a non-zero status code

Write an info message to standard out

Print a message formatted with the default formatting for the given log level

Write an notice message to standard out

Write an success message to standard out

Returns the current verbosity setting

Write an warn message to standard out

Write the given iodata directly, bypassing the log level

Write the given iodata, wrapped in the given color, but bypassing the log level

Link to this section Types

Link to this type verbosity() View Source
verbosity() :: :silent | :quiet | :normal | :verbose

Link to this section Functions

Wraps a message in the given color

Link to this function configure(verbosity) View Source
configure(verbosity()) :: :ok

Configure the logging verbosity of the release logger.

Valid verbosity settings are:

* `:silent`  - no output except errors
* `:quiet`   - no output except warnings/errors
* `:normal`  - no debug output (default)
* `:verbose` - all output
Link to this function confirm?(message) View Source
confirm?(String.t()) :: boolean()

Ask the user to confirm an action using the given message. The confirmation prompt will default to “[Yn]: “, and the regex for determining whether the action was confirmed will default to “^(y(es)?)?$”.

Use confirm/3 to provide your own prompt and answer regex.

Link to this function confirm?(message, prompt, answer_pattern) View Source
confirm?(String.t(), String.t(), Regex.t()) :: boolean()

Same as confirm/1, but takes a custom prompt and answer regex pattern. If the pattern matches the response, the action is considered confirmed.

Write an debug message to standard out.

Link to this function debugf(message, color \\ :cyan) View Source

Write a debug level message, but with minimal formatting. Default color is same as debug level

Write an error message to standard out.

Prints an error message, then terminates the VM with a non-zero status code

Write an info message to standard out.

Print a message formatted with the default formatting for the given log level

Write an notice message to standard out.

Write an success message to standard out.

Returns the current verbosity setting

Write an warn message to standard out.

Write the given iodata directly, bypassing the log level

Write the given iodata, wrapped in the given color, but bypassing the log level