El Martes, 5 de Enero de 2010, Robert Klemme escribi
> Frankly, I believe redirecting stderr to a logger instance is a broken 
> approach.  Why?  A logger has a completely different interface, i.e. it 
> accepts at least a log level and the message to log.  Based on that it 
> decides whether to output the message and how to format it.  A stream 
> like stderr readily accepts anything send to it and it will output it 
> (if there are no errors of course).  There is no formatting or deciding 
> going on.
> 
> I do not know your use case or what you want to achieve with this but it 
> seems redirecting a stream of bytes to a logger is not a good idea on 
> the design level already.

Yes, you are right. I did a hack by creating a modification of SyslogLogger 
and then:

  $stderr = SyslogLogger.new("foo")

However it's really a hack since it's just valid for "warn" method and some 
others using "$stderr.puts". But the real stderr remains being /dev/pts/N so 
if the application raises it would write on the terminal.

Finally I've dropped the idea of using a Logger as $stderr.

Thanks.


-- 
Iki Baz Castillo <ibc / aliax.net>