- From: Mike <
>
- To: "
" <
>
- Subject: [chef] Re: Re: Using the 'log' resource vs Chef::Log.<loglevel>
- Date: Mon, 8 Jul 2013 12:24:59 -0400
Thanks.
Does this impact resources updated each run? I believe a log resource
counts as an updated one every run, correct?
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?
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
How are log resources affected by resource cloning (CHEF-3694) ?
-M
On Mon, Jul 8, 2013 at 11:48 AM, Daniel DeLeo
<
>
wrote:
>
>
On Monday, July 8, 2013 at 8:30 AM, Mike wrote:
>
>
Ohai,
>
>
I am trying to understand the differences between:
>
>
log 'Here's a log line'
>
>
and:
>
>
Chef::Log.info 'Here's another log line'
>
>
from a Chef internals perspective.
>
>
Can anyone shed any pros/cons of either?
>
>
The log resource eventually calls Chef::Log. The big difference is timing; a
>
direct call to Chef::Log is just ruby that's executed in the compile phase,
>
while the resource version is added to the resource collection and then gets
>
processed in the converge phase. As a resource, you're also able to notify
>
it from other resources.
>
>
>
Thanks,
>
-M
>
>
>
>
--
>
Daniel DeLeo
>
Archive powered by MHonArc 2.6.16.