autolog 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +25 -1
- data/lib/autolog.rb +0 -1
- data/lib/autolog/methods.rb +0 -1
- data/lib/autolog/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -3,10 +3,34 @@ Autolog
|
|
3
3
|
|
4
4
|
Automatically log tracing events in Ruby more easily.
|
5
5
|
|
6
|
-
To trace Ruby, you can just define `set_trace_func`. But, why not use fewer keystrokes to output debug information? And what about just logging certain sets of events? How about:
|
6
|
+
To trace Ruby, you can just define `set_trace_func`. But, why not use fewer keystrokes to output debug information? And what about just logging certain sets of events? How about just:
|
7
7
|
|
8
8
|
autolog
|
9
9
|
|
10
|
+
Or a block:
|
11
|
+
|
12
|
+
autolog do
|
13
|
+
# ...
|
14
|
+
end
|
15
|
+
|
16
|
+
Or a block outputting method calls and c-calls:
|
17
|
+
|
18
|
+
autolog :call, :c_call do
|
19
|
+
# ...
|
20
|
+
end
|
21
|
+
|
22
|
+
### Example Output
|
23
|
+
|
24
|
+
call /path/to/.rvm/gems/ruby-1.9.3-p194@my_rails_app/gems/activerecord-3.2.8/lib/active_record/inheritance.rb.61 #<Binding:0x007fc50cf4c080> ActiveRecord::Inheritance::ClassMethods instantiate
|
25
|
+
call /path/to/.rvm/gems/ruby-1.9.3-p194@my_rails_app/gems/activerecord-3.2.8/lib/active_record/model_schema.rb.160 #<Binding:0x007fc50dec48c8> ActiveRecord::ModelSchema::ClassMethods inheritance_column
|
26
|
+
call /path/to/.rvm/gems/ruby-1.9.3-p194@my_rails_app/gems/activerecord-3.2.8/lib/active_record/model_schema.rb.160 #<Binding:0x007fc50dec40d0> ActiveRecord::ModelSchema::ClassMethods inheritance_column
|
27
|
+
return /path/to/.rvm/gems/ruby-1.9.3-p194@my_rails_app/gems/activerecord-3.2.8/lib/active_record/model_schema.rb.166 #<Binding:0x007fc50dec3c20> ActiveRecord::ModelSchema::ClassMethods inheritance_column
|
28
|
+
return /path/to/.rvm/gems/ruby-1.9.3-p194@my_rails_app/gems/activerecord-3.2.8/lib/active_record/model_schema.rb.166 #<Binding:0x007fc50dec39a0> ActiveRecord::ModelSchema::ClassMethods inheritance_column
|
29
|
+
call /path/to/.rvm/gems/ruby-1.9.3-p194@my_rails_app/gems/activerecord-3.2.8/lib/active_record/inheritance.rb.132 #<Binding:0x007fc50dec3720> ActiveRecord::Inheritance::ClassMethods find_sti_class
|
30
|
+
call /path/to/.rvm/gems/ruby-1.9.3-p194@my_rails_app/gems/mail-2.4.4/lib/mail/core_extensions/nil.rb.6 #<Binding:0x007fc50dec3388> NilClass blank?
|
31
|
+
|
32
|
+
Note: You can change the format and behavior by setting `Autolog.procedure`.
|
33
|
+
|
10
34
|
### See also
|
11
35
|
|
12
36
|
* [set_trace_func][set_trace_func]
|
data/lib/autolog.rb
CHANGED
@@ -11,7 +11,6 @@ module Autolog
|
|
11
11
|
def events(*args)
|
12
12
|
args.flatten!
|
13
13
|
args.collect!{|e|e.to_s.gsub('_','-')}
|
14
|
-
puts "events method received #{args.inspect}"
|
15
14
|
|
16
15
|
# What's up with the Exception hiding?
|
17
16
|
# Ruby bug 7180: can use up 100% cpu in 1.9.3p194 if let anything be raised. We'll silently rescue and ignore issues. Otherwise, it produces a deluge of output.
|
data/lib/autolog/methods.rb
CHANGED
data/lib/autolog/version.rb
CHANGED