public
Rubygem
Description: log_buddy is your friendly little log buddy by your side
Homepage: http://opensource.thinkrelevance.com/wiki/log_buddy
Clone URL: git://github.com/relevance/logbuddy.git
rsanheim (author)
Fri Apr 04 06:46:52 -0700 2008
commit  d578e5b4a84e4c5d761c11c08ceddd65bb0e0bee
tree    99aeb1770e404b7f2eee2b6c09e51f2b1b4680c7
parent  c00ac20a835b3eb56a140feb7ccae4063c908bf7
name age message
file .gitignore Fri Apr 04 06:46:52 -0700 2008 ignore [rsanheim]
file History.txt Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
file Manifest.txt Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
file README.rdoc Fri Apr 04 06:45:34 -0700 2008 indent [rsanheim]
file Rakefile Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
directory bin/ Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
file examples.rb Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
file init.rb Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
directory lib/ Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
file test.log Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
directory test/ Fri Apr 04 06:26:53 -0700 2008 initial commit [rsanheim]
README.rdoc

LogBuddy

  • Log bugs/issues/suggestions here: http://opensource.thinkrelevance.com/wiki/log_buddy
  • Source: http://github.com/relevance/log_buddy/tree/master
  • git clone git://github.com/relevance/log_buddy.git
  • rdocs:

DESCRIPTION:

log_buddy is your friendly little log buddy at your side, helping you dev, debug, and test.

SYNOPSIS:

Call LogBuddy.init to use log_buddy. It will add two methods to object instance and class level: "d" and "logger".

  • The "logger" method is just a typical logger - it will use the Rails logger if its available.
  • 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.

EXAMPLES:

(see also examples.rb)

    a = "foo"
    @a = "my var"
    @@bar = "class var!"
    def bark
     "woof!"
    end

    d { a }      # logs "a = 'foo'"
    d { @a }     # logs "@a = 'my var'"
    d { @@bar }  # logs "@@bar = 'class var!'"
    d { bark }   # logs "bark = woof!"

REQUIREMENTS:

  • Ruby 1.8.6 or JRuby (tested with 1.1RC3)

ISSUES

  • Be careful you don’t depend on methods that log_buddy adds to Object in production!
  • 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.
  • Don’t even try using this in irb.

INSTALL:

  • sudo gem log_buddy

LICENSE:

(The MIT License)

Copyright © 2008 Relevance, Inc. - http://thinkrelevance.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.