console-adapter-rails 0.2.0 → 0.2.1

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: dd24ef25ea142ca007009e32bf72a8b15addbc51fcd68e0b8764f4aa01b715db
4
- data.tar.gz: 64cad4283b64c45dde83f84af277354cd184eacdb1f72ac6dd34e01d65e52009
3
+ metadata.gz: f0964f1321e9dbcf587a9d6a6ab1a8b313eeb28110cda8b0e73fa96a7b1efcb3
4
+ data.tar.gz: e7c124ea18335c487c986ffda35af7aa6bb5958b5f03e903f3cc4e11fd74c516
5
5
  SHA512:
6
- metadata.gz: 06f40cdd266f29ff91da9a63b8ff6dc53ba09af52718b0c1cc2636dd73870ed006fcbf83f043183c9678bc39dfc6b0d2255675ce29da6c996c7ca59934d59e71
7
- data.tar.gz: 963a690fb77153a6509c4e8783b982ec02bf750f11dc8df63d7445ca5732746bbcc21ba5ba1c9e984680ac490f19a179fdac0e29a889b3a593a54a87124c15f6
6
+ metadata.gz: b5c28d4ad22f2547b9a44d728404f90effffb4dc82928bdf5030d61105c63132a33671ead487d71c601e24ac881a49af81bb65d22524f7d6837759d42c86f912
7
+ data.tar.gz: a75abdbe06bab6b33a45d0280eb1f58421a9fab370f29ef69fcf431faf67ac325f0aaafabf883305e3ba56184c3eec850a2deccd4fcb87b3f56414032cb819ab
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2023, by Samuel Williams.
5
+
6
+ require 'console/compatible/logger'
7
+
8
+ module Console
9
+ module Adapter
10
+ # A Rails adapter for the console logger.
11
+ module Rails
12
+ class Logger < ::Console::Compatible::Logger
13
+ include ::ActiveSupport::LoggerSilence
14
+
15
+ def self.apply!(configuration: ::Rails.configuration)
16
+ # Set the logger to a compatible logger to catch `Rails.logger` output:
17
+ configuration.logger = ActiveSupport::TaggedLogging.new(
18
+ Logger.new(::Rails)
19
+ )
20
+
21
+ # Delete `Rails::Rack::Logger` as it also doubles up on request logs:
22
+ configuration.middleware.delete ::Rails::Rack::Logger
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -6,7 +6,7 @@
6
6
  module Console
7
7
  module Adapter
8
8
  module Rails
9
- VERSION = "0.2.0"
9
+ VERSION = "0.2.1"
10
10
  end
11
11
  end
12
12
  end
@@ -4,7 +4,6 @@
4
4
  # Copyright, 2023, by Samuel Williams.
5
5
 
6
6
  require 'console'
7
- require 'console/compatible/logger'
8
7
 
9
8
  require 'active_support/log_subscriber'
10
9
  require 'active_support/tagged_logging'
@@ -12,6 +11,7 @@ require 'action_controller/log_subscriber'
12
11
  require 'action_view/log_subscriber'
13
12
  require 'active_job/log_subscriber'
14
13
 
14
+ require_relative 'rails/logger'
15
15
  require_relative 'rails/active_support'
16
16
 
17
17
  module Console
@@ -75,13 +75,7 @@ module Console
75
75
  end
76
76
 
77
77
  if configuration
78
- # Set the logger to a compatible logger to catch `Rails.logger` output:
79
- configuration.logger = ActiveSupport::TaggedLogging.new(
80
- Console::Compatible::Logger.new(::Rails)
81
- )
82
-
83
- # Delete `Rails::Rack::Logger` as it also doubles up on request logs:
84
- configuration.middleware.delete ::Rails::Rack::Logger
78
+ Logger.apply!(configuration: configuration)
85
79
  end
86
80
 
87
81
  # Attach our log subscriber for action_controller events:
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console-adapter-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -37,7 +37,7 @@ cert_chain:
37
37
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
38
38
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
39
39
  -----END CERTIFICATE-----
40
- date: 2023-08-11 00:00:00.000000000 Z
40
+ date: 2023-08-18 00:00:00.000000000 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: console
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - lib/console/adapter/rails.rb
77
77
  - lib/console/adapter/rails/active_support.rb
78
+ - lib/console/adapter/rails/logger.rb
78
79
  - lib/console/adapter/rails/version.rb
79
80
  - license.md
80
81
  - readme.md
metadata.gz.sig CHANGED
Binary file