skwpspace yan pritzker’s home on the web

skwpspace is Yan Pritzker's home on the web

Blog :: Photography :: About Me

hello, i'm yan

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Get updates by email
Follow me on twitter

Top Posts

planypus

I'm the founder of Planypus, the place to share your plans!

cohesiveft

Accessible, manageable, virtualized application stacks ready to download or deploy to the cloud!

flickr

at the paradeat the parade@slava626@leorazellman and @smazo at bat17my poor ricohyou're wearing my sweaterthe graduatethe answer, my friend

Archives

Contact

Reach me at yan at pritzker.ws

Posted
31 May 2007 @ 5pm

Tagged
planypus, rails, ruby

Tracking down stray console messages in Ruby

While working on Planypus we recently ran into an issue where something was outputting strange messages to the console. Luckily, Anton Mostovoy figured out a clever dynamic Ruby hack to track who was outputting the message:


$stdout.instance_eval do
 alias :inner_puts :write
 def write (str)
   inner_puts %Q!#{str} was said by #{caller.join("\n")}!
 end
end

Like Magic!


No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment

Helio is a Purple Cow Helio Ocean Tips & Tricks