On Fri, 3 Aug 2007, Tarmo T?nav wrote:

> 
> Hi,
> 
> Have you created a ticket for this?

No, hence my remark about wet paint.  I've not sent any
patches to rails yet, so I'm not ready to plunge in the
deep end yet either...
> 
> I don't see a problem with having this functionality, but your
> proposed interface seems a bit strange.
> 
> Why do you really need the :silent, and :silence arguments?

Trying to avoid some mysterious boolean parameter:

http://www.codinghorror.com/blog/archives/000430.html

> They seem to create redundancy: silence(:silence), and don't
> really provide additional useful information.

On or off would be weird for something that turns output off:
are you turning the offness on, or the onness on?  This seemed
the least ambiguous thing I could come up with.  But this is
another reason I didn't send it as a straight patch, there's
probably a better, clearer interface to this simple functionality
than is dreamt of in my philosophy....
> 
> I'd leave the argument boolean only. "silence(false)" and
> "silence(true)" or just "silence" all seem obvious in what
> they do, that is enable or disable silence.

But which way round???  Yes, one can look up the default, but
frankly I'd rather not.  
> 
> I'm not sure if there is a need for it, but silence() could actually
> support nesting, so you could enable it inside another block

Yes, I'd not really considered that much, but finer grained control
would be a good thing.

> that disables it. All this would require is adding a "when false"
> case into this silence implementation which enables some higher
> logging level.
> 
> Actually, to take this further, the silence method could take
> a logging level as a parameter instead of a boolean. This way
> you could arbitrarily change the logging level for code blocks

Well, at the risk of getting pecked to death by the Duck Typists
we could check the type of it.  

> and also have nesting support. Although in that case the name
> of the method should probably be changed as well.

I'm really trying to leave this so existing code can be just
changed slightly when I want logging on, despite its author
turning it off.  Changing the name would be a bigger change in
code I want to have utilize this.  I'd really like to leave
the name the same and have it backwards compatible if I can.
> 
> just my 2 EURO
> 
        Thank you,
        Hugh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to