module Output
Output handling.
Nested Classes and Modules
module DefaultDefault output format selection.
class FailureA wrapper for outputting failure messages, which can include exceptions.
class NullA null output that does nothing.
class SensitiveRedact sensitive information from output.
class SerializedSerialize log messages in a structured format.
class SplitSplit output into multiple outputs.
class TerminalRepresents a terminal output, and formats log messages for display.
module TextTerminal text output.
module XTermTerminal XTerm output.
class WrapperA generic wrapper for output handling.
Definitions
JSON = Serialized
- deprecated
Signature
- deprecated
This is a legacy constant, please use
Serializedinstead.
def self.new(output = nil, env = ENV, **options)
Create a new output based on the environment.
The environment variable CONSOLE_OUTPUT can be used to specify a list of output classes to wrap around the output. If not specified the module Console::Output::Default output is used.
The output argument is deliberately unders-specified but can be an IO object or an instance of module Console::Output.
Signature
-
parameter
outputConsole::Output The output to wrap OR an IO object.
-
parameter
envHash The environment to read configuration from.
-
parameter
optionsHash Additional options to customize the output.
-
returns
Console::Output The output instance.
Implementation
def self.new(output = nil, env = ENV, **options)
if names = env["CONSOLE_OUTPUT"]
names = names.split(",").reverse
names.inject(output) do |output, name|
Output.const_get(name).new(output, env: env, **options)
end
else
return Output::Default.new(output, env: env, **options)
end
end