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 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]
@@ -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.
@@ -2,7 +2,6 @@ module Autolog
2
2
  module Methods
3
3
  def autolog(*args)
4
4
  args.flatten!
5
- puts "autolog method got #{args.inspect}"
6
5
  if args.size > 0
7
6
  if Autolog.respond_to?(args[0])
8
7
  if block_given?
@@ -1,3 +1,3 @@
1
1
  module Autolog
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autolog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: