Class: Chef::Provider::Log::ChefLog

Inherits:
Chef::Provider show all
Defined in:
lib/chef/provider/log.rb

Overview

Chef log provider, allows logging to chef’s logs from recipes

Constant Summary

Constants included from Mixin::ShellOut

Mixin::ShellOut::DEPRECATED_OPTIONS

Instance Attribute Summary

Attributes inherited from Chef::Provider

#action, #cookbook_name, #current_resource, #new_resource, #recipe_name, #run_context

Instance Method Summary collapse

Methods inherited from Chef::Provider

#action_nothing, #cleanup_after_converge, #converge_by, #define_resource_requirements, #events, #initialize, #node, node_map, #process_resource_requirements, provides, provides?, #requirements, #resource_collection, #resource_updated?, #run_action, #set_updated_status, supports?, #whyrun_mode?

Methods included from Mixin::DescendantsTracker

#descendants, descendants, direct_descendants, #direct_descendants, find_descendants_by_name, #find_descendants_by_name, #inherited, store_inherited

Methods included from Mixin::ShellOut

#run_command_compatible_options, #shell_out, #shell_out!, #shell_out_with_systems_locale, #shell_out_with_systems_locale!

Constructor Details

This class inherits a constructor from Chef::Provider

Instance Method Details

#action_writeObject

Write the log to Chef’s log

Return

true

Always return true



46
47
48
49
# File 'lib/chef/provider/log.rb', line 46

def action_write
  Chef::Log.send(@new_resource.level, @new_resource.message)
  @new_resource.updated_by_last_action(true)
end

#load_current_resourceObject

No concept of a ‘current’ resource for logs, this is a no-op

Return

true

Always return true



38
39
40
# File 'lib/chef/provider/log.rb', line 38

def load_current_resource
  true
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/chef/provider/log.rb', line 30

def whyrun_supported?
  true
end