On Aug 2, 2009, at 2:30 PM, Nigel Kersten wrote:

>
> Did you find that Puppet.warning actually emits anything when used in
> defaults.rb though Luke?

Heh, didn't actually check that. :)

Now that you ask, no it doesn't.

>
> The patch I was going to propose when I get back to my main computer
> is one where I have to set up a new logging destination to the console
> before trying to use a warning, and I wasn't sure whether it was worth
> doing this earlier in the process than just within a specific hook
> within a specific setting....

We should just start out logging to the console and then disable that  
log later in the session, but... we don't do that.

Another (possibly simple) option is to queue all messages in a simple  
array if we have no log destination configured and then dump them once  
a dest gets configured.

The log code isn't exactly bad, but it's old and poorly organized.   
I've got all of the necessary reorganization done in some branch  
somewhere but I didn't want to just arbitrarily merge it into master  
before 0.25.  I figure I'll push it for 0.26 and it'll make any  
changes here a bit easier.

In the meantime, I recommend doing the least amount that's still  
reasonable at this point.

>
> On Sun, Aug 2, 2009 at 1:53 PM, Luke Kanies<[email protected]> wrote:
>>
>> No tests, because this is a load order problem and is essentially
>> impossible to write a test for.  I've verified it, though.
>>
>> Signed-off-by: Luke Kanies <[email protected]>
>> ---
>>  lib/puppet/util/log.rb |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb
>> index 6edc7f4..305bd2f 100644
>> --- a/lib/puppet/util/log.rb
>> +++ b/lib/puppet/util/log.rb
>> @@ -514,7 +514,7 @@ class Puppet::Util::Log
>>         # We can't store the actual source, we just store the path.
>>         # We can't just check for whether it responds to :path,  
>> because
>>         # plenty of providers respond to that in their normal  
>> function.
>> -        if (source.is_a?(Puppet::Type) or source.is_a? 
>> (Puppet::Parameter)) and source.respond_to?(:path)
>> +        if defined?(Puppet::Type) and (source.is_a?(Puppet::Type)  
>> or source.is_a?(Puppet::Parameter)) and source.respond_to?(:path)
>>             @source = source.path
>>         else
>>             @source = source.to_s
>> --
>> 1.6.1
>>
>>
>>>
>>
>
>
>
> -- 
> Nigel Kersten
> [email protected]
> System Administrator
> Google, Inc.
>
> >


-- 
Somebody has to do something, and it's just incredibly pathetic that it
has to be us. --Jerry Garcia
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply via email to