github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

relevance / log_buddy

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 38
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (3)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • gh-pages
    • master ✓
  • Tags (5)
    • v0.4.12
    • v0.4.11
    • v0.4.10
    • v0.0.5
    • 0.0.2
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

logbuddy is your friendly little log buddy by your side — Read more

  cancel

http://relevance.lighthouseapp.com/projects/19074-log-buddy/overview

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

clean up readme 
rsanheim (author)
Tue Oct 20 22:39:38 -0700 2009
commit  3769a4b010250d65b174740e47367319f809ae70
tree    19110cc9a4ef77ac161a3fd0420e9b4dc3f87cbb
parent  5c49808533bc6370f2f1bb188d5f9a9427b0b020
log_buddy /
name age
history
message
file .gitignore Fri Dec 05 06:21:51 -0800 2008 Merge branch 'spicycode/master' [rsanheim]
file .treasure_map.rb Sun Jan 18 21:51:22 -0800 2009 push 0.4.9 - add gem logging, clean up examples... [rsanheim]
file CHANGELOG Sun Apr 19 22:12:17 -0700 2009 changelog after the fact [rsanheim]
file LICENSE Loading commit data...
file README.markdown Tue Oct 20 22:39:38 -0700 2009 clean up readme [rsanheim]
file Rakefile
file VERSION.yml Fri May 22 08:04:41 -0700 2009 Version bump to 0.4.12 [rsanheim]
file examples.rb
directory examples/ Wed Sep 16 20:21:02 -0700 2009 Removing hard wired gem deps, as we don't need ... [rsanheim]
file init.rb Sat Nov 15 19:36:05 -0800 2008 massive reorg...specs are green but still a WIP [rsanheim]
directory lib/ Fri May 22 07:48:35 -0700 2009 Triaging for Ruby 1.9 (Closes #1) [spicycode]
file log_buddy.gemspec Fri May 22 08:04:46 -0700 2009 Regenerated gemspec for version 0.4.12 [rsanheim]
README.markdown

LogBuddy

DESCRIPTION

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

SYNOPSIS

Require the init.rb file to use log_buddy. By default, it will add two methods to every object at the instance and class level: "d" and "logger". To use log_buddy without the automatic object intrusion, set ENV["SAFE_LOG_BUDDY"] = true before requiring the init.rb.

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") # logs to 'my_log.log'
class MyClass; end
MyClass.logger.info("heya") # also logs to 'my_log.log'

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.

When you occasionally want to disable LogBuddy (but you don't want to have to remove all your debug statements), you can pass the :disabled option into init's options hash:

LogBuddy.init :disabled => true

REQUIREMENTS

  • Ruby 1.8.6 or JRuby (tested with 1.1RC3)
  • untested on Ruby versions before 1.8.6, but should work fine

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 at Lighthouse: http://relevance.lighthouseapp.com/projects/19074-log-buddy/overview
  • View Source: http://github.com/relevance/log_buddy
  • Git clone Source: git://github.com/relevance/log_buddy.git
  • Continuous Integration: http://runcoderun.com/relevance/log_buddy
  • RDocs: http://thinkrelevance.rubyforge.org/log_buddy

LICENSE

(The MIT License)

Copyright (c) 2009 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.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server