Every repository with this icon (
Every repository with this icon (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install relevance-log_buddy
tree e61645a1a5647353784a45fd06bef60a1d68ab9a
parent 3a50d4f5af711d34cbf15bf3aa9953969909bc43
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Jul 01 04:52:09 -0700 2008 | [rsanheim] |
| |
CHANGELOG | Mon Jun 30 20:37:00 -0700 2008 | [rsanheim] |
| |
LICENSE | Fri Apr 11 08:16:40 -0700 2008 | [rsanheim] |
| |
Manifest | Tue Jul 01 04:55:02 -0700 2008 | [rsanheim] |
| |
README.rdoc | Fri Jun 27 14:47:03 -0700 2008 | [rsanheim] |
| |
Rakefile | Tue Jul 01 06:29:45 -0700 2008 | [rsanheim] |
| |
examples.rb | Fri Apr 04 06:26:53 -0700 2008 | [rsanheim] |
| |
init.rb | Fri Apr 04 06:26:53 -0700 2008 | [rsanheim] |
| |
lib/ | Fri Jun 27 14:46:49 -0700 2008 | [rsanheim] |
| |
log_buddy.gemspec | Tue Jul 01 06:29:45 -0700 2008 | [rsanheim] |
| |
test/ | Fri Apr 04 10:47:14 -0700 2008 | [rsanheim] |
LogBuddy
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". You can use your own logger with Logbuddy by passing it into init’s options hash:
LogBuddy.init :default_logger => Logger.new('my_log.log')
Now you have your logger available from any object, at the instance level and class level:
obj = Object.new
obj.logger.debug("hi")
class MyClass; end
MyClass.logger.info("heya")
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. Its especially useful while using autotest. When you call the "d" method with an inline block, it will log the name of the things in the block and the result. Examples:
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!"
See examples.rb for live examples you can run.
REQUIREMENTS:
- Ruby 1.8.6 or JRuby (tested with 1.1RC3)
- untested on Ruby < 1.8.6, but probably works
ISSUES
- 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 install log_buddy
URLS
- Log bugs, issues, and suggestions on Trac: http://opensource.thinkrelevance.com/wiki/log_buddy
- View Source: http://github.com/relevance/logbuddy/tree/master
- Git clone Source: git://github.com/relevance/logbuddy.git
- RDocs: http://thinkrelevance.rubyforge.org/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.




