Class: Dockerspec::Builder::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/dockerspec/builder/logger.rb,
lib/dockerspec/builder/logger/ci.rb,
lib/dockerspec/builder/logger/info.rb,
lib/dockerspec/builder/logger/debug.rb,
lib/dockerspec/builder/logger/silent.rb

Overview

Creates an output logger for the Dockerspec::Builder.

Defined Under Namespace

Classes: CI, Debug, Info, Silent

Class Method Summary collapse

Class Method Details

.instance(type) ⇒ Dockerspec::Builder::Logger

Creates a logger object.

Parameters:

  • type (Integer, Symbol)

    The logger to create. Possible values: :silent or 0 (no output), :ci or 1 (enables some outputs recommended for CI environments), :info or 2 (gives information about main build steps), :debug or 3 (outputs all the provided information in its raw original form).

Returns:



45
46
47
48
49
50
51
52
53
# File 'lib/dockerspec/builder/logger.rb', line 45

def self.instance(type)
  case type.to_s.downcase
  when '0', 'silent' then Silent.new
  when '1', 'ci' then CI.new
  when '2', 'info' then Info.new
  else
    Debug.new
  end
end