rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Rack::CommonLogger does not receive Logger Instance. is this bug?
@ 2010-05-05 16:03 sanemat
  2010-05-20 14:21 ` James Tucker
  0 siblings, 1 reply; 3+ messages in thread
From: sanemat @ 2010-05-05 16:03 UTC (permalink / raw)
  To: Rack Development

hi. I'm sanemat.

I use rest-client-components and rack-common-logger.
It does not work, and I find problem in Rack::CommonLogger.

Logger Instance does not have +write+ method.
But Rack::CommonLogger's constructer require +write+ method in second
parameter.

------
NoMethodError - undefined method `write' for #<Logger:0xb736acec>:
 /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:31:in
`log'
 /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:20:in
`call'
------

modify way I think:
 a. change Logger instance
 b. change commonlogger

or anyway.

so i try 'a' way like below, and it works.

http://github.com/choonkeat/tweetstreamproxy/commit/ec82b0ac04b4f20ba33bf4f25dfb3f60e122d44c
  Logger.class_eval { alias :write :"<<" } unless
Logger.instance_methods.include? "write"

or 'b' way. like this.
http://github.com/sanemat/rack/commit/865ab9655aa2aa226a9d21b8dfd39e001c9bdeb0
change method again from +write+ to +<<+. this changed one years ago.
http://github.com/rack/rack/commit/761c6246e18b92752353c0f412976ded4a417dc5

which is better?
I confuse this.
i may be wrong but few people use Logger?

thank you.

rack 1.1.0
$ ruby -v
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux]
$ uname -a
Linux fri 2.6.32.10-90.fc12.i686 #1 SMP Tue Mar 23 10:21:29 UTC 2010
i686 i686 i386 GNU/Linux
--
sanemat

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-01 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-05 16:03 Rack::CommonLogger does not receive Logger Instance. is this bug? sanemat
2010-05-20 14:21 ` James Tucker
2012-11-01 14:55   ` Paul O'Keeffe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).