Yan Pritzker photographer, entrepreneur, software engineer, musician, skier

Blog :: Git Workflows Book :: Dotfiles :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

hello, i'm yan

I am a photographer, entrepreneur, software engineer, guitarist, climber, and telemark skier

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

Enterprise intelligence with prediction markets

Find out what your team, colleagues and partners really know about the future — and leverage their knowledge to improve business decisions.

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

Archives

Contact

Reach me at yan at pritzker.ws

Tracking down stray console messages in Ruby

Posted 31 May 2007 @ 5pm | Tagged planypus, rails, ruby


Submit to HN

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