• This repository has been archived on 30/Jan/2024
  • Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 16 years ago
  • Updated about 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

logbuddy is your friendly little log buddy by your side

LogBuddy

DESCRIPTION

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

Build Status

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 :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.7 and greater or JRuby

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

gem install log_buddy

URLS

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.

More Repositories

1

labrepl

Clojure
504
star
2

tarantula

a big hairy fuzzy spider that crawls your site, wreaking havoc
Ruby
444
star
3

rcov

The new home of RCov on GitHub
Ruby
409
star
4

streamlined

Ruby
207
star
5

diametric

Diametric is a library for building schemas, queries, and transactions for Datomic from Ruby objects.
Ruby
169
star
6

org-html-slideshow

JavaScript presentation slides generated from Emacs org-mode
Clojure
160
star
7

functional-koans

A set of common ideas for learning functional programming
156
star
8

etc

bash scripts, aliases, other misc things go here
Shell
153
star
9

clojure-conj

134
star
10

edn-ruby

Ruby implementation of Extensible Data Notation as defined by Rich Hickey
Ruby
119
star
11

cap_gun

Bang! You've deployed!
Ruby
115
star
12

castronaut

CAS Server
Ruby
101
star
13

mycroft

It's your data, look at it anywhere
Clojure
66
star
14

vasco

A route-explorer for Rails
JavaScript
57
star
15

hooppps

Ruby
56
star
16

boids

Boids flocking simulator in ClojureScript (for ClojureScript training)
JavaScript
38
star
17

blue-ridge-sample-app

Sample Rails project demonstrating JavaScript testing with Blue-Ridge
JavaScript
30
star
18

how_we_work

Relevance's How We Work site
JavaScript
22
star
19

java-tdd

TDD Examples, Labs, and References
Java
19
star
20

multi_rails

Test against many versions of Rails with a single command.
Ruby
19
star
21

spec_converter

Ruby
15
star
22

smoke_signals

CruiseControl.rb Campfire notifications
Ruby
11
star
23

cache_test

Fork of Damien Merenne's cache_test plugin. Updated to work with Rails 2.1.x.
10
star
24

jquery-demos

Demos and Presentation on jQuery
JavaScript
9
star
25

github_hook

Simple object wrapper around the Github post receive JSON payload.
Ruby
7
star
26

Iteration-Zero

Slides for Iteration Zero talk
5
star
27

clojure-async-blocks

Area to rough out async blocks in clojure
Clojure
5
star
28

prototaculous

sample code and presentation on Prototype and Scriptaculous
JavaScript
5
star
29

contegix-cloud-client

Contegix Cloud client API reference implementation
Ruby
5
star
30

relevance_rails

Relevance awesome sauce packaged up in an easy to use gem
Ruby
5
star
31

obsidian

It's metastable
Ruby
5
star
32

connectomatic

A simple gem that makes it easy to use multiple databases from Rails
Ruby
4
star
33

relevant-datetime

Datetime widget for Relevant
Ruby
4
star
34

relevant-hudson

Hudson widget for Relevant
Ruby
4
star
35

relevant-google-calendar

Google Calendar plugin for Relevant
Ruby
4
star
36

ending-legacy-code

Ending legacy code in our lifetime
4
star
37

koality

Runs opinionated code quality tools as part of you test stuite
Ruby
4
star
38

relevant-html

Simple html widget for Relevant
Ruby
3
star
39

automan

Let's just say it's awesome. Fair enough?
JavaScript
3
star
40

relevant-twitter

Twitter widget for the Relevant radiator
Ruby
3
star
41

boomstick

Boomstick tries to make it easier to explore Clojure and Datomic by generating an Ubuntu image containing a selection of Clojure editors, Datomic, and supporting software.
Shell
3
star
42

git-control

Git Control of Your Source (conference talk)
3
star
43

elzar

BAM!
Ruby
3
star
44

relevant-eventbrite-signups

Show event signups on Relevant
Ruby
3
star
45

jvm-shootout

JVM Shootout: Examples and presentation on various JVM languages
Clojure
3
star
46

relevant-widget

Base widget functionality for widgets
Ruby
3
star
47

relevant-github

View github feeds via Relevant
Ruby
3
star
48

rails-template

Build a Rails template for Relevance projects!
Ruby
3
star
49

relevance_portfolio_iteration_switcher

Simple switcher for navigating between iterations of projects in our portfolio.
Ruby
1
star
50

fluxion

Asynchronous metric collection, aggregation, and delivery
Clojure
1
star
51

slushy

Aussie kitchenhand helping in the provisional kitchen with Fog and Chef
Ruby
1
star
52

refactotum

Refactotum -- Presentation for RailsConf 2011 Refactotum Tutorial
1
star