log_sanity 2.1.2 → 2.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c28332ecf2daf12ad4b7f43fe6e322b22db9d3988d6a386a863bcfb23079c72
4
- data.tar.gz: '0789db0e2dee84e0248a950e999a1d48dfc4aea1f9650ae45b873ddf4982ba57'
3
+ metadata.gz: d613c22d31fcb596cc1e0f541fc0ad4276c15f676bb745bdb6a25bef91776ff7
4
+ data.tar.gz: ae3e8726988cfb06a3abc80cb0bcab3c589a8be69734daa12ab5e292973bfd39
5
5
  SHA512:
6
- metadata.gz: 56788f3c81a6337cecaf2a710bc41cf8c9430b5f57ce4ae5483b296b3ab9059ab574c0b089eb338cf91333379ecce4418d86c4836eed87bd5b7823511cd17b78
7
- data.tar.gz: a05e761fb82ef26f6c02a3d1e99ada217a275f171ea2fa8317e84a0d2c6f26f0e42e185192433a412520394e7d2eb747c26f96c4711d97996058111bb453dc66
6
+ metadata.gz: d105457230a833fe578edbdc5ba963b52cf66236341aa5f80fc634a2e9f954ec82eba63c55467bfac50fb505f732131b7312cb223e517178aa433f8fa2b2346a
7
+ data.tar.gz: 59b7a90ce10d634523831e778699c4e5e56419e00db9d09979b56a50052c8332647161274a93ee8666ff0db2aa9508c5f6a53088a2334de7534cb3c0939d4594
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ #### 2.3.0
2
+
3
+ - Support Rails 8.0
4
+
5
+ #### 2.2.0
6
+
7
+ - Add DB query counts for ActiveRecord 7.2
8
+ Only real queries are reported; cached queries are excluded
9
+
1
10
  #### 2.1.2
2
11
 
3
12
  - In ActiveJob logs, output gid:// when available instead of using .to_json
data/Gemfile.lock CHANGED
@@ -1,104 +1,103 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- log_sanity (2.1.2)
5
- rails (>= 7.1.2, < 7.2)
4
+ log_sanity (2.3.0)
5
+ rails (>= 7.1.2, < 8.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.1.3.2)
11
- actionpack (= 7.1.3.2)
12
- activesupport (= 7.1.3.2)
10
+ actioncable (8.0.0)
11
+ actionpack (= 8.0.0)
12
+ activesupport (= 8.0.0)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
15
  zeitwerk (~> 2.6)
16
- actionmailbox (7.1.3.2)
17
- actionpack (= 7.1.3.2)
18
- activejob (= 7.1.3.2)
19
- activerecord (= 7.1.3.2)
20
- activestorage (= 7.1.3.2)
21
- activesupport (= 7.1.3.2)
22
- mail (>= 2.7.1)
23
- net-imap
24
- net-pop
25
- net-smtp
26
- actionmailer (7.1.3.2)
27
- actionpack (= 7.1.3.2)
28
- actionview (= 7.1.3.2)
29
- activejob (= 7.1.3.2)
30
- activesupport (= 7.1.3.2)
31
- mail (~> 2.5, >= 2.5.4)
32
- net-imap
33
- net-pop
34
- net-smtp
16
+ actionmailbox (8.0.0)
17
+ actionpack (= 8.0.0)
18
+ activejob (= 8.0.0)
19
+ activerecord (= 8.0.0)
20
+ activestorage (= 8.0.0)
21
+ activesupport (= 8.0.0)
22
+ mail (>= 2.8.0)
23
+ actionmailer (8.0.0)
24
+ actionpack (= 8.0.0)
25
+ actionview (= 8.0.0)
26
+ activejob (= 8.0.0)
27
+ activesupport (= 8.0.0)
28
+ mail (>= 2.8.0)
35
29
  rails-dom-testing (~> 2.2)
36
- actionpack (7.1.3.2)
37
- actionview (= 7.1.3.2)
38
- activesupport (= 7.1.3.2)
30
+ actionpack (8.0.0)
31
+ actionview (= 8.0.0)
32
+ activesupport (= 8.0.0)
39
33
  nokogiri (>= 1.8.5)
40
- racc
41
34
  rack (>= 2.2.4)
42
35
  rack-session (>= 1.0.1)
43
36
  rack-test (>= 0.6.3)
44
37
  rails-dom-testing (~> 2.2)
45
38
  rails-html-sanitizer (~> 1.6)
46
- actiontext (7.1.3.2)
47
- actionpack (= 7.1.3.2)
48
- activerecord (= 7.1.3.2)
49
- activestorage (= 7.1.3.2)
50
- activesupport (= 7.1.3.2)
39
+ useragent (~> 0.16)
40
+ actiontext (8.0.0)
41
+ actionpack (= 8.0.0)
42
+ activerecord (= 8.0.0)
43
+ activestorage (= 8.0.0)
44
+ activesupport (= 8.0.0)
51
45
  globalid (>= 0.6.0)
52
46
  nokogiri (>= 1.8.5)
53
- actionview (7.1.3.2)
54
- activesupport (= 7.1.3.2)
47
+ actionview (8.0.0)
48
+ activesupport (= 8.0.0)
55
49
  builder (~> 3.1)
56
50
  erubi (~> 1.11)
57
51
  rails-dom-testing (~> 2.2)
58
52
  rails-html-sanitizer (~> 1.6)
59
- activejob (7.1.3.2)
60
- activesupport (= 7.1.3.2)
53
+ activejob (8.0.0)
54
+ activesupport (= 8.0.0)
61
55
  globalid (>= 0.3.6)
62
- activemodel (7.1.3.2)
63
- activesupport (= 7.1.3.2)
64
- activerecord (7.1.3.2)
65
- activemodel (= 7.1.3.2)
66
- activesupport (= 7.1.3.2)
56
+ activemodel (8.0.0)
57
+ activesupport (= 8.0.0)
58
+ activerecord (8.0.0)
59
+ activemodel (= 8.0.0)
60
+ activesupport (= 8.0.0)
67
61
  timeout (>= 0.4.0)
68
- activestorage (7.1.3.2)
69
- actionpack (= 7.1.3.2)
70
- activejob (= 7.1.3.2)
71
- activerecord (= 7.1.3.2)
72
- activesupport (= 7.1.3.2)
62
+ activestorage (8.0.0)
63
+ actionpack (= 8.0.0)
64
+ activejob (= 8.0.0)
65
+ activerecord (= 8.0.0)
66
+ activesupport (= 8.0.0)
73
67
  marcel (~> 1.0)
74
- activesupport (7.1.3.2)
68
+ activesupport (8.0.0)
75
69
  base64
70
+ benchmark (>= 0.3)
76
71
  bigdecimal
77
- concurrent-ruby (~> 1.0, >= 1.0.2)
72
+ concurrent-ruby (~> 1.0, >= 1.3.1)
78
73
  connection_pool (>= 2.2.5)
79
74
  drb
80
75
  i18n (>= 1.6, < 2)
76
+ logger (>= 1.4.2)
81
77
  minitest (>= 5.1)
82
- mutex_m
83
- tzinfo (~> 2.0)
78
+ securerandom (>= 0.3)
79
+ tzinfo (~> 2.0, >= 2.0.5)
80
+ uri (>= 0.13.1)
84
81
  base64 (0.2.0)
85
- bigdecimal (3.1.7)
86
- builder (3.2.4)
87
- concurrent-ruby (1.2.3)
82
+ benchmark (0.4.0)
83
+ bigdecimal (3.1.8)
84
+ builder (3.3.0)
85
+ concurrent-ruby (1.3.4)
88
86
  connection_pool (2.4.1)
89
87
  crass (1.0.6)
90
- date (3.3.4)
88
+ date (3.4.0)
91
89
  drb (2.2.1)
92
- erubi (1.12.0)
90
+ erubi (1.13.0)
93
91
  globalid (1.2.1)
94
92
  activesupport (>= 6.1)
95
- i18n (1.14.4)
93
+ i18n (1.14.6)
96
94
  concurrent-ruby (~> 1.0)
97
95
  io-console (0.7.2)
98
- irb (1.13.0)
96
+ irb (1.14.1)
99
97
  rdoc (>= 4.0.0)
100
98
  reline (>= 0.4.2)
101
- loofah (2.22.0)
99
+ logger (1.6.1)
100
+ loofah (2.23.1)
102
101
  crass (~> 1.0.2)
103
102
  nokogiri (>= 1.12.0)
104
103
  mail (2.8.1)
@@ -108,9 +107,8 @@ GEM
108
107
  net-smtp
109
108
  marcel (1.0.4)
110
109
  mini_mime (1.1.5)
111
- minitest (5.22.3)
112
- mutex_m (0.2.0)
113
- net-imap (0.4.10)
110
+ minitest (5.25.2)
111
+ net-imap (0.5.1)
114
112
  date
115
113
  net-protocol
116
114
  net-pop (0.1.2)
@@ -119,38 +117,37 @@ GEM
119
117
  timeout
120
118
  net-smtp (0.5.0)
121
119
  net-protocol
122
- nio4r (2.7.1)
123
- nokogiri (1.16.4-arm64-darwin)
120
+ nio4r (2.7.4)
121
+ nokogiri (1.16.7-arm64-darwin)
124
122
  racc (~> 1.4)
125
- nokogiri (1.16.4-x86_64-darwin)
123
+ nokogiri (1.16.7-x86_64-darwin)
126
124
  racc (~> 1.4)
127
- nokogiri (1.16.4-x86_64-linux)
125
+ nokogiri (1.16.7-x86_64-linux)
128
126
  racc (~> 1.4)
129
- psych (5.1.2)
127
+ psych (5.2.0)
130
128
  stringio
131
- racc (1.7.3)
132
- rack (3.0.10)
129
+ racc (1.8.1)
130
+ rack (3.1.8)
133
131
  rack-session (2.0.0)
134
132
  rack (>= 3.0.0)
135
133
  rack-test (2.1.0)
136
134
  rack (>= 1.3)
137
- rackup (2.1.0)
135
+ rackup (2.2.1)
138
136
  rack (>= 3)
139
- webrick (~> 1.8)
140
- rails (7.1.3.2)
141
- actioncable (= 7.1.3.2)
142
- actionmailbox (= 7.1.3.2)
143
- actionmailer (= 7.1.3.2)
144
- actionpack (= 7.1.3.2)
145
- actiontext (= 7.1.3.2)
146
- actionview (= 7.1.3.2)
147
- activejob (= 7.1.3.2)
148
- activemodel (= 7.1.3.2)
149
- activerecord (= 7.1.3.2)
150
- activestorage (= 7.1.3.2)
151
- activesupport (= 7.1.3.2)
137
+ rails (8.0.0)
138
+ actioncable (= 8.0.0)
139
+ actionmailbox (= 8.0.0)
140
+ actionmailer (= 8.0.0)
141
+ actionpack (= 8.0.0)
142
+ actiontext (= 8.0.0)
143
+ actionview (= 8.0.0)
144
+ activejob (= 8.0.0)
145
+ activemodel (= 8.0.0)
146
+ activerecord (= 8.0.0)
147
+ activestorage (= 8.0.0)
148
+ activesupport (= 8.0.0)
152
149
  bundler (>= 1.15.0)
153
- railties (= 7.1.3.2)
150
+ railties (= 8.0.0)
154
151
  rails-dom-testing (2.2.0)
155
152
  activesupport (>= 5.0.0)
156
153
  minitest
@@ -158,29 +155,31 @@ GEM
158
155
  rails-html-sanitizer (1.6.0)
159
156
  loofah (~> 2.21)
160
157
  nokogiri (~> 1.14)
161
- railties (7.1.3.2)
162
- actionpack (= 7.1.3.2)
163
- activesupport (= 7.1.3.2)
164
- irb
158
+ railties (8.0.0)
159
+ actionpack (= 8.0.0)
160
+ activesupport (= 8.0.0)
161
+ irb (~> 1.13)
165
162
  rackup (>= 1.0.0)
166
163
  rake (>= 12.2)
167
164
  thor (~> 1.0, >= 1.2.2)
168
165
  zeitwerk (~> 2.6)
169
166
  rake (13.2.1)
170
- rdoc (6.6.3.1)
167
+ rdoc (6.8.1)
171
168
  psych (>= 4.0.0)
172
- reline (0.5.5)
169
+ reline (0.5.11)
173
170
  io-console (~> 0.5)
174
- stringio (3.1.0)
175
- thor (1.3.1)
176
- timeout (0.4.1)
171
+ securerandom (0.3.2)
172
+ stringio (3.1.2)
173
+ thor (1.3.2)
174
+ timeout (0.4.2)
177
175
  tzinfo (2.0.6)
178
176
  concurrent-ruby (~> 1.0)
179
- webrick (1.8.1)
177
+ uri (1.0.2)
178
+ useragent (0.16.10)
180
179
  websocket-driver (0.7.6)
181
180
  websocket-extensions (>= 0.1.0)
182
181
  websocket-extensions (0.1.5)
183
- zeitwerk (2.6.13)
182
+ zeitwerk (2.7.1)
184
183
 
185
184
  PLATFORMS
186
185
  arm64-darwin
@@ -191,4 +190,4 @@ DEPENDENCIES
191
190
  log_sanity!
192
191
 
193
192
  BUNDLED WITH
194
- 2.4.10
193
+ 2.5.22
data/README.md CHANGED
@@ -185,8 +185,6 @@ There are still some things that could be handled better (such as multi-line str
185
185
 
186
186
  Pull requests are welcomed and encouraged. The only goal is to avoid making things unnecessarily complex.
187
187
 
188
- Tested on Rails 5.2 through 7.1 (or later). Anything older is untested. Small patches for older compatibility will be considered.
189
-
190
188
  License: MIT
191
189
 
192
190
 
@@ -23,14 +23,24 @@ module LogSanity
23
23
  end
24
24
 
25
25
  durations = {'total' => event.duration.round}
26
+ queries = {}
26
27
  additions = ::ActionController::Base.log_process_action(payload)
27
28
  additions.each do |add|
28
29
  if add =~ /^([^:]+):?\s*([0-9.]+)(ms)?/
29
30
  ms = $2.to_f.round
30
- durations[$1.downcase] = ms if ms > 0
31
+ name = $1.downcase
32
+ durations[name] = ms if ms > 0
33
+ end
34
+ if name and add =~ /[^0-9]([0-9]+) quer/
35
+ q_real = $1.to_i
36
+ if q_real > 0 and add =~ /[^0-9]([0-9]+) cached/
37
+ q_real -= $1.to_i # exclude cached queries
38
+ end
39
+ queries[name] = q_real if q_real > 0
31
40
  end
32
41
  end
33
42
 
43
+ log 'queries', queries if queries.any?
34
44
  log 'duration', durations
35
45
  log 'status', status
36
46
  end
@@ -1,3 +1,3 @@
1
1
  module LogSanity
2
- VERSION = '2.1.2'
2
+ VERSION = '2.3.0'
3
3
  end
data/log_sanity.gemspec CHANGED
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency 'rails', '>= 7.1.2', '< 7.2'
20
+ s.add_dependency 'rails', '>= 7.1.2', '< 8.1'
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_sanity
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-04 00:00:00.000000000 Z
11
+ date: 2024-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 7.1.2
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.2'
22
+ version: '8.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 7.1.2
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.2'
32
+ version: '8.1'
33
33
  description: LogSanity - Bring sanity to Rails logs by reducing verbosity, using json
34
34
  output, and more.
35
35
  email:
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.5.9
124
+ rubygems_version: 3.5.22
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: LogSanity - Bring sanity to Rails logs