activesupport-broadcast_logger 2.0.3 → 3.0.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +156 -3
- data/LICENSE.md +11 -0
- data/README.md +447 -184
- data/lib/active_support/broadcast_logger.rb +11 -0
- data/lib/activesupport/broadcast_logger/version.rb +4 -5
- data/lib/activesupport/broadcast_logger.rb +1 -1
- data/lib/activesupport-broadcast_logger.rb +2 -12
- data/sig/activesupport/broadcast_logger.rbs +19 -0
- data.tar.gz.sig +0 -0
- metadata +247 -107
- metadata.gz.sig +0 -0
- data/CODE_OF_CONDUCT.md +0 -84
- data/CONTRIBUTING.md +0 -106
- data/LICENSE.txt +0 -22
- data/SECURITY.md +0 -13
|
@@ -2,3 +2,14 @@
|
|
|
2
2
|
# It will prevent vanilla ActiveSupport from loading its own broken logger tooling.
|
|
3
3
|
# Instead, we'll load the fixed replacement logging tooling from this library!
|
|
4
4
|
require_relative "../activesupport-broadcast_logger"
|
|
5
|
+
|
|
6
|
+
# In Rails 5: `ActiveSupport::Logger.broadcast console` was called from the ActiveRecord Railtie.
|
|
7
|
+
# We just need to stub that so it doesn't die, because this gem stack sets up logging separately.
|
|
8
|
+
ActiveSupport::Logger.class_eval do
|
|
9
|
+
class << self
|
|
10
|
+
# Needs to return a module...
|
|
11
|
+
def broadcast(*_)
|
|
12
|
+
Module.new
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -5,7 +5,7 @@ module ActiveSupport
|
|
|
5
5
|
#
|
|
6
6
|
# The Broadcast logger is a logger used to write messages to multiple IO. It is commonly used
|
|
7
7
|
# in development to display messages on STDOUT and also write them to a file (development.log).
|
|
8
|
-
# With the Broadcast logger, you can broadcast your logs to
|
|
8
|
+
# With the Broadcast logger, you can broadcast your logs to an unlimited number of sinks.
|
|
9
9
|
#
|
|
10
10
|
# The BroadcastLogger acts as a standard logger and all methods you are used to are available.
|
|
11
11
|
# However, all the methods on this logger will propagate and be delegated to the other loggers
|
|
@@ -3,7 +3,6 @@ require "active_support/version"
|
|
|
3
3
|
require "version_gem"
|
|
4
4
|
|
|
5
5
|
# This library
|
|
6
|
-
require_relative "activesupport/broadcast_logger/version"
|
|
7
6
|
|
|
8
7
|
# Loads supporting features from Rails v5, 6, or 7
|
|
9
8
|
require "active_support/core_ext/module/delegation"
|
|
@@ -12,16 +11,6 @@ require "active_support/core_ext/object/blank"
|
|
|
12
11
|
# Require the extracted-from-Rails-8 ActiveSupport::Logger
|
|
13
12
|
require "activesupport-logger"
|
|
14
13
|
|
|
15
|
-
# Require original broadcast logging from whatever version of Rails is loaded,
|
|
16
|
-
# so that it will be properly monkey patched.
|
|
17
|
-
# Versions of Rails < 7.1 do not have it, which is fine,
|
|
18
|
-
# as the purpose of this gem is to make it available, while also fixing it.
|
|
19
|
-
begin
|
|
20
|
-
require "active_support/broadcast_logger"
|
|
21
|
-
rescue LoadError
|
|
22
|
-
warn("[Activesupport::BroadcastLogger] ActiveSupport::BroadcastLogger is not available. Your Rails will be enhanced to have it!")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
14
|
# !!ORDER MATTERS!!
|
|
26
15
|
|
|
27
16
|
# Extracted from:
|
|
@@ -33,11 +22,12 @@ end
|
|
|
33
22
|
# All this reloading might print warnings about redefined methods, and this is expected.
|
|
34
23
|
# Technically it might even break things, but we don't expect it to, and YMMV.
|
|
35
24
|
require_relative "activesupport/broadcast_logger"
|
|
25
|
+
require_relative "activesupport/broadcast_logger/version"
|
|
36
26
|
|
|
37
27
|
# Namespace for the Version of this gem (and nothing else)
|
|
38
28
|
module Activesupport
|
|
39
29
|
end
|
|
40
30
|
|
|
41
|
-
|
|
31
|
+
ActiveSupport::BroadcastLoggerVersion.class_eval do
|
|
42
32
|
extend VersionGem::Basic
|
|
43
33
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Activesupport
|
|
2
|
+
module BroadcastLogger
|
|
3
|
+
VERSION: String
|
|
4
|
+
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
module ActiveSupport
|
|
9
|
+
module Version
|
|
10
|
+
VERSION: String
|
|
11
|
+
end
|
|
12
|
+
VERSION: String
|
|
13
|
+
module BroadcastLogger
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
module BroadcastLoggerVersion
|
|
17
|
+
VERSION: String
|
|
18
|
+
end
|
|
19
|
+
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|