heavylog 0.0.27 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58b2541fe38a594b5bd231b7c38ee9f5228a06e1659f4261d18871d073d641e7
4
- data.tar.gz: 14fb4af4400e246433af3a3c65f67c251f40f90a3ef80fffc36f308ce3031efa
3
+ metadata.gz: 67f8f650ce028d5d665e91dcf433598cac9f2e43b5f0bc27e4b275741ccbd9e0
4
+ data.tar.gz: 10e83a39f390df38b8bb1d47ea9fdc508591f390a1f42f428a34d2deb8ea84d8
5
5
  SHA512:
6
- metadata.gz: 879da51b9aa219f6836357544dfde89f84224719fe34aa7e9e0eda3359c6b50d7e6e12eef0e440583e23d97a4418d840b28e0a102c611deb7d9c88f03cbd8470
7
- data.tar.gz: 50d5b572eede80737c577f575b8cec5b2fbde76c17b54acd73e0772bb4ae2b1f8f707a52d16e2187c01580637118ce814247043089957f291cc4ae8f88a9f273
6
+ metadata.gz: 1881fefdd481ac8129676698e71fff044207f6ec39add42eaf4ecb512208a321e74c2e3daeb9e34da5e79d133845355460adbf158fb8d9a160473dce480e86f7
7
+ data.tar.gz: 9cbad0db88d74272274966840c5d3d84fde5b4a8d3f21d1d605a2f54c921d6e2f2ef18acc686f79982e3a7908c5aa462e4d16976b222f02c9f7bb58221a60e49
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.3.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heavylog (0.0.27)
4
+ heavylog (0.1.0)
5
5
  actionpack (>= 5)
6
6
  activesupport (>= 5)
7
7
  railties (>= 5)
@@ -10,92 +10,123 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (7.0.4)
14
- actionview (= 7.0.4)
15
- activesupport (= 7.0.4)
16
- rack (~> 2.0, >= 2.2.0)
13
+ actionpack (7.1.3.2)
14
+ actionview (= 7.1.3.2)
15
+ activesupport (= 7.1.3.2)
16
+ nokogiri (>= 1.8.5)
17
+ racc
18
+ rack (>= 2.2.4)
19
+ rack-session (>= 1.0.1)
17
20
  rack-test (>= 0.6.3)
18
- rails-dom-testing (~> 2.0)
19
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
20
- actionview (7.0.4)
21
- activesupport (= 7.0.4)
21
+ rails-dom-testing (~> 2.2)
22
+ rails-html-sanitizer (~> 1.6)
23
+ actionview (7.1.3.2)
24
+ activesupport (= 7.1.3.2)
22
25
  builder (~> 3.1)
23
- erubi (~> 1.4)
24
- rails-dom-testing (~> 2.0)
25
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
26
- activesupport (7.0.4)
26
+ erubi (~> 1.11)
27
+ rails-dom-testing (~> 2.2)
28
+ rails-html-sanitizer (~> 1.6)
29
+ activesupport (7.1.3.2)
30
+ base64
31
+ bigdecimal
27
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
33
+ connection_pool (>= 2.2.5)
34
+ drb
28
35
  i18n (>= 1.6, < 2)
29
36
  minitest (>= 5.1)
37
+ mutex_m
30
38
  tzinfo (~> 2.0)
31
39
  ast (2.4.2)
32
40
  backport (1.2.0)
33
- benchmark (0.2.0)
41
+ base64 (0.2.0)
42
+ benchmark (0.3.0)
43
+ bigdecimal (3.1.6)
34
44
  builder (3.2.4)
35
- concurrent-ruby (1.1.10)
36
- connection_pool (2.2.5)
45
+ concurrent-ruby (1.2.3)
46
+ connection_pool (2.4.1)
37
47
  crass (1.0.6)
38
- diff-lcs (1.5.0)
48
+ diff-lcs (1.5.1)
39
49
  docile (1.4.0)
50
+ drb (2.2.1)
40
51
  e2mmap (0.1.0)
41
52
  erubi (1.12.0)
42
- i18n (1.12.0)
53
+ i18n (1.14.1)
43
54
  concurrent-ruby (~> 1.0)
44
- jaro_winkler (1.5.4)
55
+ io-console (0.7.2)
56
+ irb (1.11.2)
57
+ rdoc
58
+ reline (>= 0.4.2)
59
+ jaro_winkler (1.5.6)
45
60
  kramdown (2.4.0)
46
61
  rexml
47
62
  kramdown-parser-gfm (1.1.0)
48
63
  kramdown (~> 2.0)
49
- loofah (2.19.1)
64
+ loofah (2.22.0)
50
65
  crass (~> 1.0.2)
51
- nokogiri (>= 1.5.9)
52
- method_source (1.0.0)
53
- mini_portile2 (2.8.0)
54
- minitest (5.17.0)
55
- nokogiri (1.13.10)
56
- mini_portile2 (~> 2.8.0)
66
+ nokogiri (>= 1.12.0)
67
+ mini_portile2 (2.8.5)
68
+ minitest (5.22.2)
69
+ mutex_m (0.2.0)
70
+ nokogiri (1.16.2)
71
+ mini_portile2 (~> 2.8.2)
57
72
  racc (~> 1.4)
58
- parallel (1.22.1)
59
- parser (3.1.2.0)
73
+ parallel (1.24.0)
74
+ parser (3.3.0.5)
60
75
  ast (~> 2.4.1)
61
- racc (1.6.1)
62
- rack (2.2.4)
63
- rack-test (2.0.2)
76
+ racc
77
+ psych (5.1.2)
78
+ stringio
79
+ racc (1.7.3)
80
+ rack (3.0.9.1)
81
+ rack-session (2.0.0)
82
+ rack (>= 3.0.0)
83
+ rack-test (2.1.0)
64
84
  rack (>= 1.3)
65
- rails-dom-testing (2.0.3)
66
- activesupport (>= 4.2.0)
85
+ rackup (2.1.0)
86
+ rack (>= 3)
87
+ webrick (~> 1.8)
88
+ rails-dom-testing (2.2.0)
89
+ activesupport (>= 5.0.0)
90
+ minitest
67
91
  nokogiri (>= 1.6)
68
- rails-html-sanitizer (1.4.4)
69
- loofah (~> 2.19, >= 2.19.1)
70
- railties (7.0.4)
71
- actionpack (= 7.0.4)
72
- activesupport (= 7.0.4)
73
- method_source
92
+ rails-html-sanitizer (1.6.0)
93
+ loofah (~> 2.21)
94
+ nokogiri (~> 1.14)
95
+ railties (7.1.3.2)
96
+ actionpack (= 7.1.3.2)
97
+ activesupport (= 7.1.3.2)
98
+ irb
99
+ rackup (>= 1.0.0)
74
100
  rake (>= 12.2)
75
- thor (~> 1.0)
76
- zeitwerk (~> 2.5)
101
+ thor (~> 1.0, >= 1.2.2)
102
+ zeitwerk (~> 2.6)
77
103
  rainbow (3.1.1)
78
- rake (13.0.6)
79
- redis (4.7.1)
80
- regexp_parser (2.5.0)
81
- request_store (1.5.1)
104
+ rake (13.1.0)
105
+ rdoc (6.6.2)
106
+ psych (>= 4.0.0)
107
+ redis-client (0.20.0)
108
+ connection_pool
109
+ regexp_parser (2.9.0)
110
+ reline (0.4.3)
111
+ io-console (~> 0.5)
112
+ request_store (1.6.0)
82
113
  rack (>= 1.4)
83
114
  reverse_markdown (2.1.1)
84
115
  nokogiri
85
- rexml (3.2.5)
86
- rspec (3.11.0)
87
- rspec-core (~> 3.11.0)
88
- rspec-expectations (~> 3.11.0)
89
- rspec-mocks (~> 3.11.0)
90
- rspec-core (3.11.0)
91
- rspec-support (~> 3.11.0)
92
- rspec-expectations (3.11.0)
116
+ rexml (3.2.6)
117
+ rspec (3.13.0)
118
+ rspec-core (~> 3.13.0)
119
+ rspec-expectations (~> 3.13.0)
120
+ rspec-mocks (~> 3.13.0)
121
+ rspec-core (3.13.0)
122
+ rspec-support (~> 3.13.0)
123
+ rspec-expectations (3.13.0)
93
124
  diff-lcs (>= 1.2.0, < 2.0)
94
- rspec-support (~> 3.11.0)
95
- rspec-mocks (3.11.1)
125
+ rspec-support (~> 3.13.0)
126
+ rspec-mocks (3.13.0)
96
127
  diff-lcs (>= 1.2.0, < 2.0)
97
- rspec-support (~> 3.11.0)
98
- rspec-support (3.11.0)
128
+ rspec-support (~> 3.13.0)
129
+ rspec-support (3.13.1)
99
130
  rubocop (0.93.1)
100
131
  parallel (~> 1.10)
101
132
  parser (>= 2.7.1.5)
@@ -105,15 +136,16 @@ GEM
105
136
  rubocop-ast (>= 0.6.0)
106
137
  ruby-progressbar (~> 1.7)
107
138
  unicode-display_width (>= 1.4.0, < 2.0)
108
- rubocop-ast (1.19.1)
109
- parser (>= 3.1.1.0)
139
+ rubocop-ast (1.31.1)
140
+ parser (>= 3.3.0.4)
110
141
  rubocop-performance (1.5.2)
111
142
  rubocop (>= 0.71.0)
112
- ruby-progressbar (1.11.0)
113
- sidekiq (6.5.1)
114
- connection_pool (>= 2.2.2)
115
- rack (~> 2.0)
116
- redis (>= 4.2.0)
143
+ ruby-progressbar (1.13.0)
144
+ sidekiq (7.2.2)
145
+ concurrent-ruby (< 2)
146
+ connection_pool (>= 2.3.0)
147
+ rack (>= 2.2.4)
148
+ redis-client (>= 0.19.0)
117
149
  simplecov (0.21.2)
118
150
  docile (~> 1.1)
119
151
  simplecov-html (~> 0.11)
@@ -123,7 +155,7 @@ GEM
123
155
  simplecov (~> 0.19)
124
156
  simplecov-html (0.12.3)
125
157
  simplecov_json_formatter (0.1.4)
126
- solargraph (0.45.0)
158
+ solargraph (0.48.0)
127
159
  backport (~> 1.2)
128
160
  benchmark
129
161
  bundler (>= 1.17.2)
@@ -138,15 +170,15 @@ GEM
138
170
  thor (~> 1.0)
139
171
  tilt (~> 2.0)
140
172
  yard (~> 0.9, >= 0.9.24)
141
- thor (1.2.1)
142
- tilt (2.0.10)
143
- tzinfo (2.0.5)
173
+ stringio (3.1.0)
174
+ thor (1.3.1)
175
+ tilt (2.3.0)
176
+ tzinfo (2.0.6)
144
177
  concurrent-ruby (~> 1.0)
145
178
  unicode-display_width (1.8.0)
146
- webrick (1.7.0)
147
- yard (0.9.28)
148
- webrick (~> 1.7.0)
149
- zeitwerk (2.6.6)
179
+ webrick (1.8.1)
180
+ yard (0.9.36)
181
+ zeitwerk (2.6.13)
150
182
 
151
183
  PLATFORMS
152
184
  ruby
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Heavylog
4
+ class ProxyLogger < ::Logger
5
+ def initialize
6
+ super(nil)
7
+ end
8
+
9
+ def add(severity, message=nil, progname=nil, &block)
10
+ Heavylog.log(severity, message, progname, &block)
11
+ end
12
+
13
+ def loggable?
14
+ true
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Heavylog
4
- VERSION = "0.0.27"
4
+ VERSION = "0.1.0"
5
5
  end
data/lib/heavylog.rb CHANGED
@@ -8,6 +8,7 @@ require "heavylog/log_subscriber"
8
8
  require "heavylog/middleware"
9
9
  require "heavylog/ordered_options"
10
10
  require "heavylog/request_logger"
11
+ require "heavylog/proxy_logger"
11
12
  require "heavylog/sidekiq_logger"
12
13
  require "heavylog/sidekiq_exception_handler"
13
14
 
@@ -29,7 +30,13 @@ module Heavylog
29
30
  end
30
31
 
31
32
  def patch_loggers
32
- Rails.logger.extend(RequestLogger) if defined?(Rails)
33
+ return unless defined?(Rails)
34
+
35
+ if Rails.logger.respond_to?(:broadcast_to)
36
+ Rails.logger.broadcast_to(ProxyLogger.new)
37
+ else
38
+ Rails.logger.extend(RequestLogger)
39
+ end
33
40
  end
34
41
 
35
42
  def set_options
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heavylog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristjan Rang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-01 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -220,6 +220,7 @@ files:
220
220
  - lib/heavylog/log_subscriber.rb
221
221
  - lib/heavylog/middleware.rb
222
222
  - lib/heavylog/ordered_options.rb
223
+ - lib/heavylog/proxy_logger.rb
223
224
  - lib/heavylog/railtie.rb
224
225
  - lib/heavylog/request_logger.rb
225
226
  - lib/heavylog/sidekiq_exception_handler.rb
@@ -244,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
245
  - !ruby/object:Gem::Version
245
246
  version: '0'
246
247
  requirements: []
247
- rubygems_version: 3.3.7
248
+ rubygems_version: 3.5.3
248
249
  signing_key:
249
250
  specification_version: 4
250
251
  summary: Format all Rails logging per request