contextual_logger 0.1.0 → 0.2.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
  SHA1:
3
- metadata.gz: 792d027e06730423ee08c1321a92d05b75d9c9a2
4
- data.tar.gz: 4feda11871b919feeda59f2a94a7bd48e18412f5
3
+ metadata.gz: 64307a3414ac0fb04573871f21c614517d448af9
4
+ data.tar.gz: cc89a84b0f36ed86012ca745b83983b2fb424a39
5
5
  SHA512:
6
- metadata.gz: 9dc835d30281ef8f52135a5040dc7fa708a1b22d4e20a5d0d4e1e5d5560afd2cc51decd0cd3e238a8ef3160dd4c50f670a6d4b70bd7cf14b127da62574b5b9cc
7
- data.tar.gz: 8b59b651971148697c2f2e8cdc633278a25667bb00e7c54186cfe8d8f8f0a12556a6eb143e117a25944dcda1b5d91c15fafedd915dd753ae7a74f92437cc9f3b
6
+ metadata.gz: dd79a3bdfa4c79de7d1f7d02baecd70f554f57cf2eccfde85847341ee34d3c9271ab226cc1b6f32a88fea546f545316d2e998b504b230e53714d8c2d03dffe34
7
+ data.tar.gz: bf773c138bc8073e22e7f5cb08b63178f58168950e29cc12948430114f46effccbce52519417f823bd1cc486545c8bd50697f6e20c5c06bbf08851337bcb1204
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveSupport
4
+ module TaggedLogging
5
+ module Formatter
6
+ def call(severity, timestamp, progname, msg)
7
+ msg_with_tags = case msg
8
+ when Hash
9
+ msg.merge(log_tags: current_tags.join(', '))
10
+ else
11
+ "#{tags_text}#{msg}"
12
+ end
13
+
14
+ super(severity, timestamp, progname, msg_with_tags)
15
+ end
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contextual_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Ebentier
@@ -31,6 +31,7 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - lib/contextual_logger.rb
34
+ - lib/contextual_logger/overrides/active_support/tagged_logging/formatter.rb
34
35
  homepage: https://rubygems.org/gems/contextual_logger
35
36
  licenses:
36
37
  - MIT