Quick and dirty debugging anywhere!
Sometimes you just want to see whether a method was called. Those times you don’t want to write out some rubbish just to see that. Why not just write
def some_method omg! # do stuff end
When the method is called, in the log you will find
~~~~~~~~~~~~~~~~~~~~~~~~~~~ OMG! some_method called! ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Or, pass an object to omg! and it will print out the result of the object’s inspect method.
Works with Rails.logger if it is available or $stdout if it isn’t.
Want your own logger? Of course! Just grab the OmgLogger instance and set it to your logger like this:
omg_logger = OmgLogger.instance omg_logger.log_with(custom_logger, :custom_logging_method)
Easy.
Copyright © 2010 philnash. See LICENSE for details.