rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: sanemat <ogataken@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Rack::CommonLogger does not receive Logger Instance. is this bug?
Date: Wed, 5 May 2010 09:03:16 -0700 (PDT)	[thread overview]
Message-ID: <4c699dd9-5da3-45b4-88b1-e1e0001c4a44@y18g2000prn.googlegroups.com> (raw)

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

             reply	other threads:[~2010-05-05 22:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 16:03 sanemat [this message]
2010-05-20 14:21 ` Rack::CommonLogger does not receive Logger Instance. is this bug? James Tucker
2012-11-01 14:55   ` Paul O'Keeffe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c699dd9-5da3-45b4-88b1-e1e0001c4a44@y18g2000prn.googlegroups.com \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).