[chef] Re: Re: Re: Using the 'log' resource vs Chef::Log.


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Re: Using the 'log' resource vs Chef::Log.<loglevel>
  • Date: Mon, 8 Jul 2013 09:33:28 -0700


On Monday, July 8, 2013 at 9:24 AM, Mike wrote:

Thanks.

Does this impact resources updated each run? I believe a log resource
counts as an updated one every run, correct?
Yes, it's similar to an execute or ruby_block resource in this regard.
 

From a pure idiom sense, which would be preferable to use? Can/should
a recipe's logging be closer to the execution phase or not?
Depends on the situation. Think about it from the perspective of a user of the recipe who hasn't read the code. Where is the message most useful?
 

And I'm guessing that these are equivalent?

Chef::Log.debug "Only seen when in debug mode"

log "Only seen in debug mode" do
level :debug
end

Aside from the compile/converge phase stuff (which will control where the log message actually appears), these are identical. 


How are log resources affected by resource cloning (CHEF-3694) ?
All resource types are affected by resource cloning in the same way. If a resource's type+name match a previously defined resource's type+name, it will be created from a clone instead of created from scratch.
 
-M

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§