Skip to content

Instantly share code, notes, and snippets.

@localshred
Created February 28, 2012 00:02
Show Gist options
  • Save localshred/1928007 to your computer and use it in GitHub Desktop.
Save localshred/1928007 to your computer and use it in GitHub Desktop.
Have stdout/err output you just can't track down? Use this. It needs to be inserted in the earliest possible load path (like spec_helper or rails boot.rb)
def STDOUT.puts *args
super(*args)
STDERR.puts(caller[0..5]) if args.any?{|a| a.to_s =~ /my semi-unique string/ }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment