rorvswild 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -0
- data/lib/rorvswild/installer.rb +1 -0
- data/lib/rorvswild/plugin/action_controller.rb +15 -16
- data/lib/rorvswild/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 823ab7934d6f40bcf1e9cea8b11b67709fdf3291ee7f751c214bc326f27ffb57
|
4
|
+
data.tar.gz: d886b176eeb69afc9c02e927cf783319d310e9854160aac9769ec0fb8fe4b0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afc6de959ccc4f34dad4fd318c55a2bb55d844b66dfed98acada8c729f84cdad334f28394178ed90cc11582b95da94b35b101467bc0e6cda806cf14482814635
|
7
|
+
data.tar.gz: c2a28c624fd45b76adc2b3718dc3994db0418166de4b3b40d51d5eb11f72f4a9405d9a752c6dac1f98a632cda0f632117387dea08fa4982aa524cbc38b1b91b0
|
data/README.md
CHANGED
@@ -167,6 +167,32 @@ Finally here is the list of all plugins you can ignore :
|
|
167
167
|
- Resque
|
168
168
|
- Sidekiq
|
169
169
|
|
170
|
+
#### Change logger
|
171
|
+
|
172
|
+
By default RorVsWild uses `Rails.logger` or standard output. However in some cases you want to isolate RorVsWild's logs.
|
173
|
+
To do that, you have to specifiy the log destination via the `logger` option :
|
174
|
+
|
175
|
+
```yaml
|
176
|
+
# config/rorvswild.yml
|
177
|
+
production:
|
178
|
+
api_key: API_KEY
|
179
|
+
logger: log/rorvswild.yml
|
180
|
+
```
|
181
|
+
|
182
|
+
Here is the equivalent if you prefer initialising RorVsWild manually :
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
# config/initializers/rorvswild.rb
|
186
|
+
RorVsWild.start(api_key: "API_KEY", logger: "log/rorvswild.log")
|
187
|
+
```
|
188
|
+
|
189
|
+
In the case you want a custom logger such as Syslog, you can only do it by initialising it manually :
|
190
|
+
|
191
|
+
```ruby
|
192
|
+
# config/initializers/rorvswild.rb
|
193
|
+
RorVsWild.start(api_key: "API_KEY", logger: Logger::Syslog.new)
|
194
|
+
```
|
195
|
+
|
170
196
|
## Contributing
|
171
197
|
|
172
198
|
1. Fork it ( https://github.com/[my-github-username]/rorvswild/fork )
|
data/lib/rorvswild/installer.rb
CHANGED
@@ -4,29 +4,28 @@ module RorVsWild
|
|
4
4
|
def self.setup
|
5
5
|
return if @installed
|
6
6
|
return unless defined?(::ActionController::Base)
|
7
|
-
|
7
|
+
::ActionController::Base.around_action(&method(:around_action))
|
8
8
|
::ActionController::Base.rescue_from(StandardError) { |ex| RorVsWild::Plugin::ActionController.after_exception(ex, self) }
|
9
9
|
@installed = true
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
controller_action = "#{
|
14
|
-
if
|
15
|
-
|
16
|
-
RorVsWild.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
def self.around_action(controller, block)
|
13
|
+
controller_action = "#{controller.class}##{controller.action_name}"
|
14
|
+
return block.call if RorVsWild.agent.ignored_request?(controller_action)
|
15
|
+
begin
|
16
|
+
RorVsWild::Section.start do |section|
|
17
|
+
method_name = controller.method_for_action(controller.action_name)
|
18
|
+
section.file, section.line = controller.method(method_name).source_location
|
19
|
+
section.file = RorVsWild.agent.locator.relative_path(section.file)
|
20
|
+
section.command = "#{controller.class}##{method_name}"
|
21
|
+
RorVsWild.agent.current_data[:name] = controller_action
|
22
|
+
end
|
23
|
+
block.call
|
24
|
+
ensure
|
25
|
+
RorVsWild::Section.stop
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
26
|
-
def finish(name, id, payload)
|
27
|
-
RorVsWild::Section.stop
|
28
|
-
end
|
29
|
-
|
30
29
|
def self.after_exception(exception, controller)
|
31
30
|
if hash = RorVsWild.agent.push_exception(exception)
|
32
31
|
hash[:session] = controller.session.to_hash
|
data/lib/rorvswild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rorvswild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Performances and quality insights for rails developers.
|
14
14
|
email:
|