module Athena::Console::Output::Interface

Overview

Athena::Console uses a dedicated interface for representing an output destination. This allows it to have multiple more specialized implementations as opposed to being tightly coupled to STDOUT or a raw IO. This interface represents the methods that must be implemented, however implementations can add additional functionality.

The most common implementations include ACON::Output::ConsoleOutput which is based on STDOUT and STDERR, and ACON::Output::Null which can be used when you want to silent all output, such as for tests.

Each output's ACON::Output::Verbosity and output ACON::Output::Type can also be configured on a per message basis.

Direct including types

Defined in:

output/interface.cr

Instance Method Summary

Instance Method Detail

abstract def decorated=(decorated : Bool) : Nil #

Sets if printed messages should be decorated.


[View source]
abstract def decorated? : Bool #

Returns true if printed messages should have their decorations applied. I.e. ACON::Formatter::OutputStyleInterface.


[View source]
abstract def formatter : ACON::Formatter::Interface #

Returns the ACON::Formatter::Interface used by self.


[View source]
abstract def formatter=(formatter : ACON::Formatter::Interface) : Nil #

Sets the ACON::Formatter::Interface used by self.


[View source]
abstract def print(message : String | Enumerable(String), verbosity : ACON::Output::Verbosity = :normal, output_type : ACON::Output::Type = :normal) : Nil #

Outputs the provided message. The verbosity and/or output_type parameters can be used to control when and how the message is printed.


[View source]
abstract def puts(message : String | Enumerable(String), verbosity : ACON::Output::Verbosity = :normal, output_type : ACON::Output::Type = :normal) : Nil #

Outputs the provided message followed by a new line. The verbosity and/or output_type parameters can be used to control when and how the message is printed.


[View source]
abstract def verbosity : ACON::Output::Verbosity #

Returns the minimum ACON::Output::Verbosity required for a message to be printed.


[View source]
abstract def verbosity=(verbosity : ACON::Output::Verbosity) : Nil #

Set the minimum ACON::Output::Verbosity required for a message to be printed.


[View source]