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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/console/adapter/rails/logger.rb +27 -0
- data/lib/console/adapter/rails/version.rb +1 -1
- data/lib/console/adapter/rails.rb +2 -8
- data.tar.gz.sig +0 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0964f1321e9dbcf587a9d6a6ab1a8b313eeb28110cda8b0e73fa96a7b1efcb3
|
4
|
+
data.tar.gz: e7c124ea18335c487c986ffda35af7aa6bb5958b5f03e903f3cc4e11fd74c516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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
|
-
|
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.
|
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-
|
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
|