# module Chef::Formatters

## Chef::Formatters¶ ↑

Formatters handle printing output about the progress/status of a chef client run to the user's screen.

### Public Class Methods

available_formatters() click to toggle source

    # File lib/chef/formatters/base.rb, line 46
    def self.available_formatters
      formatters_by_name.keys
    end

by_name(name) click to toggle source

    # File lib/chef/formatters/base.rb, line 42
    def self.by_name(name)
      formatters_by_name[name]
    end

formatters_by_name() click to toggle source

    # File lib/chef/formatters/base.rb, line 34
    def self.formatters_by_name
      @formatters_by_name ||= {}
    end

new(name, out, err) click to toggle source

    # File lib/chef/formatters/base.rb, line 52
    def self.new(name, out, err)
      formatter_class = by_name(name.to_s) or
        raise UnknownFormatter, "No output formatter found for #{name} (available: #{available_formatters.join(', ')})"

      formatter_class.new(out, err)
    end

register(name, formatter) click to toggle source

    # File lib/chef/formatters/base.rb, line 38
    def self.register(name, formatter)
      formatters_by_name[name.to_s] = formatter
    end