The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Proxy Logging

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Christopher Cyll

Posts: 49
Nickname: topher
Registered: Jan, 2006

Topher Cyll is Rubyist and writer in Portland, Oregon.
Proxy Logging Posted: Jul 18, 2006 8:23 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Christopher Cyll.
Original Post: Proxy Logging
Feed Title: Topher Cyll
Feed URL: http://feeds.feedburner.com/cyll
Feed Description: I'm not too worried about it. Ruby and programming languages.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Christopher Cyll
Latest Posts From Topher Cyll

Advertisement
Once in a while it helps to log the messages an object gets. I usually use this trick:

require 'pp'
class LogProxy
  def initialize(object)
    @object = object
  end

  def method_missing(sym, *args, &block)
    pp [args, block]
    @object.send(sym, *args, &block)
  end
end

I then wrap my object to be logged and watch the command line. It's a simple trick, but often helps me debug object protocols.

Read: Proxy Logging

Topic: Revamping Win32API Previous Topic   Next Topic Topic: Will the Enterprise change Ruby, or will Ruby change the Enterprise?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use