0
-* Log bugs/issues/suggestions here: http://opensource.thinkrelevance.com/wiki/log_buddy
0
-* Source: http://github.com/relevance/log_buddy/tree/master
0
-* git clone git://github.com/relevance/log_buddy.git
0
-* rdocs: http://thinkrelevance.rubyforge.org/log_buddy/
0
log_buddy is your friendly little log buddy at your side, helping you dev, debug, and test.
0
-Call LogBuddy.init to use log_buddy. It will add two methods to object instance and class level: "d" and "logger".
0
+Call LogBuddy.init to use log_buddy. It will add two methods to object instance and class level: "d" and "logger". You can
0
+use your own logger with Logbuddy by passing it into init's options hash:
0
+ LogBuddy.init :default_logger => Logger.new('my_log.log')
0
+Now you have your logger available from any object, at the instance level and class level:
0
-* The "logger" method is just a typical logger - it will use the Rails logger if its available.
0
-* The "d" method is a special helper that will output the code in the block and its result - note that you *must* use the bracket block form - do...end is not supported.
0
+ obj.logger.debug("hi")
0
+ MyClass.logger.info("heya")
0
+You also have a method called "d" (for "debug") on any object, which is used for quick debugging and logging of things while you are developing.
0
+Its especially useful while using autotest. When you call the "d" method with an inline block, it will log the name of the things
0
+in the block and the result. Examples:
0
d { bark } # logs "bark = woof!"
0
+See examples.rb for live examples you can run.
0
* Ruby 1.8.6 or JRuby (tested with 1.1RC3)
0
+* untested on Ruby < 1.8.6, but probably works
0
-* Be careful you don't depend on methods that log_buddy adds to Object in production!
0
* This is meant for non-production use while developing and testing --> it does stuff that is slow and you probably don't want happening in your production environment.
0
* Don't even try using this in irb.
0
+* Log bugs, issues, and suggestions on Trac: http://opensource.thinkrelevance.com/wiki/log_buddy
0
+* View Source: http://github.com/relevance/log_buddy/tree/master
0
+* Git clone Source: git://github.com/relevance/log_buddy.git
0
+* RDocs: http://thinkrelevance.rubyforge.org/log_buddy/
Comments
No one has commented yet.