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

Instance Attribute Summary

Attributes inherited from Chef::Provider

#action, #current_resource, #new_resource, #run_context

Instance Method Summary collapse

Methods inherited from Chef::Provider

#action_nothing, #cleanup_after_converge, #cookbook_name, #define_resource_requirements, #events, #initialize, #node, #process_resource_requirements, #requirements, #resource_collection, #run_action, #set_updated_status, #whyrun_mode?, #whyrun_supported?

Methods included from DSL::Recipe

#method_missing

Methods included from Mixin::ConvertToClassName

#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename

Constructor Details

This class inherits a constructor from Chef::Provider

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Chef::DSL::Recipe

Instance Method Details

#action_writeObject

Write the log to Chef’s log

Return

true

Always return true



40
41
42
43
# File 'lib/chef/provider/log.rb', line 40

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



32
33
34
# File 'lib/chef/provider/log.rb', line 32

def load_current_resource
  true
end