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
Search Repo:
update readme and clean up
rsanheim (author)
Fri Apr 04 14:16:30 -0700 2008
commit  1614396c40bea7b60e0e310fae9c297920503a9d
tree    6337ce95938e04d4d537e3adf8873036f72f7d5e
parent  be68fdbc03b410768b8b5d30236ce8d09e8de2b8
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
 
 
 
 
 
15
16
17
 
 
 
 
18
19
 
 
 
20
21
22
23
24
25
26
27
28
...
33
34
35
 
 
36
37
38
 
39
40
41
42
43
44
45
46
47
48
 
 
 
 
 
 
 
49
50
51
...
1
2
 
 
 
 
 
3
4
5
6
7
8
 
9
10
11
12
13
14
15
 
 
16
17
18
19
20
 
21
22
23
24
 
 
25
26
27
28
29
30
...
35
36
37
38
39
40
41
42
43
44
45
46
 
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
0
@@ -1,25 +1,27 @@
0
 = LogBuddy
0
   
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
-
0
 == DESCRIPTION:
0
 
0
 log_buddy is your friendly little log buddy at your side, helping you dev, debug, and test.
0
 
0
 == SYNOPSIS:
0
 
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
+
0
+ LogBuddy.init :default_logger => Logger.new('my_log.log')
0
+
0
+Now you have your logger available from any object, at the instance level and class level:
0
 
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 = Object.new
0
+ obj.logger.debug("hi")
0
+ class MyClass; end
0
+ MyClass.logger.info("heya")
0
 
0
-== EXAMPLES:
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
 
0
-(see also examples.rb)
0
-
0
     a = "foo"
0
     @a = "my var"
0
     @@bar = "class var!"
0
0
0
0
@@ -33,19 +35,28 @@
0
     d { bark } # logs "bark = woof!"
0
 
0
 
0
+See examples.rb for live examples you can run.
0
+
0
 == REQUIREMENTS:
0
 
0
 * Ruby 1.8.6 or JRuby (tested with 1.1RC3)
0
+* untested on Ruby < 1.8.6, but probably works
0
  
0
 == ISSUES
0
 
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
 
0
 == INSTALL:
0
 
0
 * sudo gem log_buddy
0
+
0
+== URLS
0
+
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/
0
 
0
 == LICENSE:
0
 
...
21
22
23
24
25
26
27
...
21
22
23
 
24
25
26
0
@@ -21,7 +21,6 @@
0
   # rd.options << '-d' if RUBY_PLATFORM !~ /win32/ and `which dot` =~ /\/dot/ and not ENV['NODOT']
0
   rd.rdoc_dir = 'doc'
0
   files = hoe.spec.files.grep(hoe.rdoc_pattern)
0
- p files
0
   files -= ['Manifest.txt']
0
   rd.rdoc_files.push(*files)
0
 

Comments

    No one has commented yet.