rack-insight 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,16 @@
1
+ == 0.5.7 / 2012-09-03 (Peter Boling)
2
+
3
+ * Bug Fixes
4
+
5
+ * require 'logger' important when using Ruby Logger
6
+
7
+ == 0.5.6 / 2012-08-31 (Peter Boling)
8
+
9
+ * Other
10
+
11
+ * Wrap debug logging in verbose check
12
+ * Documentation
13
+
1
14
  == 0.5.5 / 2012-08-31 (Peter Boling)
2
15
 
3
16
  * New Features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-insight (0.5.5)
4
+ rack-insight (0.5.6)
5
5
  rack
6
6
  sqlite3 (>= 1.3.3)
7
7
  uuidtools (>= 2.1.2)
data/README.md CHANGED
@@ -76,6 +76,35 @@ spec/fixtures folder for an example Sinatra app.
76
76
  If you wish to use the logger panel define the LOGGER constant that is a ruby
77
77
  Logger or ActiveSupport::BufferedLogger
78
78
 
79
+ Configure Rack::Insight
80
+ ----------------------
81
+
82
+ Pattern:
83
+
84
+ Rack::Insight::Config.configure do |config|
85
+ config[:option] = value
86
+ end
87
+
88
+ Options:
89
+
90
+ :logger - Can be set to any Ruby-esque Logger, examples include the Rails Logger, or the Ruby Logger (default).
91
+ If you do not set logger Rack::Insight defaults to the Ruby Logger.
92
+ You can configure it with additional options:
93
+ :log_file - The logdev parameter for the Ruby Logger (a file path, an IO, like STDOUT, or STDERR, etc)
94
+ :log_level - The maximum severity at which things should be logged.
95
+
96
+ :rails_log_copy - If you are setting :logger to the Rails Logger, you should set this to false (default is true).
97
+
98
+ :verbosity - true is default .
99
+ true is equivalent to relying soley on the logger's log level to determine if a message is logged.
100
+ Other potential values are:
101
+ anything falsey => no logging at all
102
+ Rack::Insight::Logging::VERBOSITY[*level*] where *level* is one of:
103
+ :debug, :high, :med, :low, :silent
104
+
105
+ :panel_load_paths => [File::join('rack', 'insight', 'panels')] (default)
106
+ See *Configuring custom panels* section for example usage
107
+
79
108
  Configuring custom panels
80
109
  -------------------------
81
110
 
data/lib/rack/insight.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'logger'
1
2
  require 'rack/insight/app'
2
3
 
3
4
  module Rack
@@ -71,7 +71,9 @@ module Rack::Insight
71
71
  end
72
72
 
73
73
  def start_event(method_call, arguments)
74
- logger.debug{ "Starting event: #{method_call.context} #{method_call.kind} #{method_call.method}" } if verbose(:high)
74
+ if verbose(:high)
75
+ logger.debug{ "Starting event: #{method_call.context} #{method_call.kind} #{method_call.method}" }
76
+ end
75
77
 
76
78
  collectors_for(method_call).each do |collector|
77
79
  collector.before_detect(method_call, arguments)
@@ -80,7 +82,9 @@ module Rack::Insight
80
82
 
81
83
  def finish_event(method_call, arguments, start_time, result)
82
84
  timing = Timing.new(@start, start_time, Time.now)
83
- logger.debug{ "Finishing event: #{method_call.context} #{method_call.kind} #{method_call.method}" } if verbose(:high)
85
+ if verbose(:high)
86
+ logger.debug{ "Finishing event: #{method_call.context} #{method_call.kind} #{method_call.method}" }
87
+ end
84
88
  collectors_for(method_call).each do |collector|
85
89
  collector.after_detect(method_call, timing, arguments, result)
86
90
  end
@@ -1,7 +1,7 @@
1
1
  module Rack
2
2
  module Insight
3
3
 
4
- VERSION = '0.5.6'
4
+ VERSION = '0.5.7'
5
5
 
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-insight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-08-31 00:00:00.000000000 Z
15
+ date: 2012-09-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack