Class | Chef::Formatters::Base
In: | lib/chef/formatters/base.rb
Parent: | EventDispatch::Base

## Formatters::Base

Base class that all formatters should inherit from.

### Methods

attribute_file_load_failed attribute_file_loaded cli_name cookbook_resolution_failed cookbook_sync_failed definition_file_load_failed definition_file_loaded display_error file_load_failed file_loaded library_file_load_failed library_file_loaded lwrp_file_load_failed lwrp_file_loaded new node_load_failed print puts recipe_file_load_failed recipe_file_loaded recipe_not_found registration_failed resource_failed run_list_expand_failed

### Included Modules

ErrorMapper

### Attributes

err | [R] |
out | [R] |
output | [R] |

### Public Class methods

cli_name(name)
new(out, err)

### Public Instance methods

attribute_file_load_failed(path, exception)

Delegates to file_load_failed

attribute_file_loaded(path)

Delegates to file_loaded

cookbook_resolution_failed(expanded_run_list, exception)
cookbook_sync_failed(cookbooks, exception)
definition_file_load_failed(path, exception)

Delegates to file_load_failed

definition_file_loaded(path)

Delegates to file_loaded

display_error(description)

Input: a Formatters::ErrorDescription object. Outputs error to SDOUT.

file_load_failed(path, exception)

Generic callback for any attribute/library/lwrp/recipe file throwing an exception when loaded. Default behavior is to use CompileErrorInspector to print contextual info about the failure.

file_loaded(path)

Generic callback for any attribute/library/lwrp/recipe file in a cookbook getting loaded. The per-filetype callbacks for file load are overriden so that they call this instead. This means that a subclass of Formatters::Base can implement file_loaded to do the same thing for every kind of file that Chef loads from a recipe instead of implementing all the per-filetype callbacks.

library_file_load_failed(path, exception)

Delegates to file_load_failed

library_file_loaded(path)

Delegates to file_loaded

lwrp_file_load_failed(path, exception)

Delegates to file_load_failed

lwrp_file_loaded(path)

Delegates to file_loaded

node_load_failed(node_name, exception, config)
print(*args)
puts(*args)
recipe_file_load_failed(path, exception)

Delegates to file_load_failed

recipe_file_loaded(path)

Delegates to file_loaded

recipe_not_found(exception)
registration_failed(node_name, exception, config)
resource_failed(resource, action, exception)
run_list_expand_failed(node, exception)

[Validate]