logtail-rails 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +12 -0
- data/gemfiles/rails-edge.gemfile +12 -0
- data/lib/logtail-rails/action_controller/log_subscriber.rb +1 -0
- data/lib/logtail-rails/action_view/log_subscriber/logtail_log_subscriber.rb +13 -0
- data/lib/logtail-rails/active_support_log_subscriber.rb +5 -0
- data/lib/logtail-rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d238560ec59e0d1b0d936ae0b3b92e11865ba2e80fcc4adeb4d6cb43676c7ae
|
4
|
+
data.tar.gz: 97e280b2a2c9297a0862dbbd733a4a36e902928b749be07bed9c904243a167f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc9b5ab10bb6cb45a9896a1056399c5adb5a8297cc06d7b424bd077884ff3848c6892d526004a2c3dc620ff4b2ce0505fc589be9c0d3b4d60485fd8165b7d5eb
|
7
|
+
data.tar.gz: 2cbd54fa234e026c71feba8f050e41d6a5b5ae513b806548921943bade86665248a826274d949924b4607a7ce1e72e2fb31137629991ac3cf3c30f59c3d5983c
|
data/.github/workflows/main.yml
CHANGED
@@ -27,6 +27,7 @@ jobs:
|
|
27
27
|
- truffleruby-23.0.0
|
28
28
|
- truffleruby-22.1.0
|
29
29
|
gemfile:
|
30
|
+
- rails-edge
|
30
31
|
- rails-7.0
|
31
32
|
- rails-6.1
|
32
33
|
- rails-6.0
|
@@ -34,6 +35,17 @@ jobs:
|
|
34
35
|
- rails-5.1
|
35
36
|
- rails-5.0
|
36
37
|
exclude:
|
38
|
+
- gemfile: rails-edge
|
39
|
+
ruby-version: 2.6.6
|
40
|
+
- gemfile: rails-edge
|
41
|
+
ruby-version: 2.5.8
|
42
|
+
- gemfile: rails-edge
|
43
|
+
ruby-version: jruby-9.4.3.0
|
44
|
+
- gemfile: rails-edge
|
45
|
+
ruby-version: jruby-9.2.14.0
|
46
|
+
- gemfile: rails-edge
|
47
|
+
ruby-version: truffleruby-23.0.0
|
48
|
+
|
37
49
|
- gemfile: rails-7.0
|
38
50
|
ruby-version: 2.6.6
|
39
51
|
- gemfile: rails-7.0
|
@@ -25,6 +25,7 @@ module Logtail
|
|
25
25
|
)
|
26
26
|
end
|
27
27
|
end
|
28
|
+
subscribe_log_level :render_template, :info if defined?(subscribe_log_level)
|
28
29
|
|
29
30
|
def render_partial(event)
|
30
31
|
return true if silence?
|
@@ -66,6 +67,18 @@ module Logtail
|
|
66
67
|
end
|
67
68
|
end
|
68
69
|
|
70
|
+
def self.attach_to(*)
|
71
|
+
super
|
72
|
+
|
73
|
+
if ::Rails::VERSION::MAJOR > 7 || ::Rails::VERSION::MAJOR == 7 && ::Rails::VERSION::MINOR >= 1
|
74
|
+
# Clean extra listeners subscribed in parent's attach_to method
|
75
|
+
::ActiveSupport::Notifications.notifier.listeners_for("render_template.action_view")
|
76
|
+
.concat(::ActiveSupport::Notifications.notifier.listeners_for("render_layout.action_view")).flatten
|
77
|
+
.filter { |listener| listener.delegate.class == ::ActionView::LogSubscriber::Start }
|
78
|
+
.each { |listener| ActiveSupport::Notifications.unsubscribe(listener) }
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
69
82
|
private
|
70
83
|
def log_rendering_start(*args)
|
71
84
|
# Consolidates 2 template rendering events into 1. We don't need 2 events for
|
@@ -18,6 +18,11 @@ module Logtail
|
|
18
18
|
# I don't know why this has to be so complicated, but it is. This code was taken from
|
19
19
|
# lograge :/
|
20
20
|
def unsubscribe!(component, type)
|
21
|
+
if defined?(type.detach_from)
|
22
|
+
type.detach_from(component)
|
23
|
+
return
|
24
|
+
end
|
25
|
+
|
21
26
|
subscriber = find(component, type)
|
22
27
|
|
23
28
|
if !subscriber
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logtail-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Better Stack
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logtail
|
@@ -306,6 +306,7 @@ files:
|
|
306
306
|
- gemfiles/rails-6.0.gemfile
|
307
307
|
- gemfiles/rails-6.1.gemfile
|
308
308
|
- gemfiles/rails-7.0.gemfile
|
309
|
+
- gemfiles/rails-edge.gemfile
|
309
310
|
- lib/logtail-rails.rb
|
310
311
|
- lib/logtail-rails/action_controller.rb
|
311
312
|
- lib/logtail-rails/action_controller/log_subscriber.rb
|