- From: Mike <
>
- To: "
" <
>
- Subject: [chef] Re: Re: Re: Re: Using the 'log' resource vs Chef::Log.<loglevel>
- Date: Mon, 8 Jul 2013 12:43:42 -0400
Thanks for the awesome answers - this is very helpful.
>
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.
Will a log resource with a level of debug be created/updated when the
Chef run isn't in debug mode, and not be displayed? Or is the resource
evaluated at compile phase, and determined "we;re not running in debug
mode, don't add this to the collection"?
-M
On Mon, Jul 8, 2013 at 12:33 PM, Daniel DeLeo
<
>
wrote:
>
>
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.