lumberjack 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/VERSION +1 -1
- data/lib/lumberjack.rb +1 -0
- data/lib/lumberjack/tagged_logging.rb +29 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 477e85433c8d726c881946ab35ad3d3fc1cffc20ceeec9efc41a74f7bf91ef8d
|
4
|
+
data.tar.gz: 325441e14a7f92374002069190cc3c9324e5ccae48a550aae705f177e877d62b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2161522abc951fd9db62a6594bb5dbea0eb392aac7f42960818dbfe673f34822fcd6d3af3037a5ba6029f837ec54880c992b959a503a133c9be30ff81ae75c94
|
7
|
+
data.tar.gz: cb0bea0a04c752eb2597ec57befc6391955adfb39f26201041ce7023c458e69b83a36ccdd1bdaeaa7bb04f41686441c6e083461fa40775b563570300507032f4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -85,13 +85,13 @@ logger.info("no requests") # Will not include the `request_id` tag
|
|
85
85
|
|
86
86
|
Tag keys are always converted to strings. Tags are inherited so that message tags take precedence over block tags which take precedence over global tags.
|
87
87
|
|
88
|
-
#### Compatibility with ActiveSupport::
|
88
|
+
#### Compatibility with ActiveSupport::TaggedLogging
|
89
89
|
|
90
|
-
`Lumberjack::Logger` version 1.1.2 or greater is compatible with `ActiveSupport::
|
90
|
+
`Lumberjack::Logger` version 1.1.2 or greater is compatible with `ActiveSupport::TaggedLogging`. This is so that other code that expect to have a logger that responds to the `tagged` method will work. Any tags added with the `tagged` method will be appended to an array in the the "tagged" tag.
|
91
91
|
|
92
92
|
```ruby
|
93
|
-
logger.tagged("foo", "bar=1", "
|
94
|
-
logger.info("here") # will include tags: {"tagged" => ["foo", "
|
93
|
+
logger.tagged("foo", "bar=1", "other") do
|
94
|
+
logger.info("here") # will include tags: {"tagged" => ["foo", "bar=1", "other"]}
|
95
95
|
end
|
96
96
|
```
|
97
97
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.4
|
data/lib/lumberjack.rb
CHANGED
@@ -19,6 +19,7 @@ module Lumberjack
|
|
19
19
|
require_relative "lumberjack/tags.rb"
|
20
20
|
require_relative "lumberjack/tag_formatter.rb"
|
21
21
|
require_relative "lumberjack/tagged_logger_support.rb"
|
22
|
+
require_relative "lumberjack/tagged_logging.rb"
|
22
23
|
require_relative "lumberjack/template.rb"
|
23
24
|
require_relative "lumberjack/rack.rb"
|
24
25
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Lumberjack
|
4
|
+
# Monkey patch for ActiveSupport::TaggedLogger so it doesn't blow up when
|
5
|
+
# a Lumberjack logger is trying to be wrapped. This module will be automatically
|
6
|
+
# included in ActiveSupport::TaggedLogger if activesupport is already loaded.
|
7
|
+
module TaggedLogging
|
8
|
+
class << self
|
9
|
+
def included(base)
|
10
|
+
base.singleton_class.send(:prepend, ClassMethods)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module ClassMethods
|
15
|
+
def new(logger)
|
16
|
+
if logger.is_a?(Lumberjack::Logger)
|
17
|
+
logger = logger.tagged_logger! unless logger.respond_to?(:tagged)
|
18
|
+
logger
|
19
|
+
else
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
if defined?(ActiveSupport::TaggedLogging)
|
28
|
+
ActiveSupport::TaggedLogging.include(Lumberjack::TaggedLogging)
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lumberjack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/lumberjack/severity.rb
|
107
107
|
- lib/lumberjack/tag_formatter.rb
|
108
108
|
- lib/lumberjack/tagged_logger_support.rb
|
109
|
+
- lib/lumberjack/tagged_logging.rb
|
109
110
|
- lib/lumberjack/tags.rb
|
110
111
|
- lib/lumberjack/template.rb
|
111
112
|
- lumberjack.gemspec
|