json_tagged_logger 0.6.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca97d589d38e918e570eab76849c3589dcb4afcffdc40d225f41ea5a61933dba
4
- data.tar.gz: a7bcb458e29394d91f312cf2b0cb478a43a46f546810fdad6837221456ca2ffc
3
+ metadata.gz: c43ee559e53a24cf5c12cd1163c1fd8713d8351cd3e6cc6b175dd92fd840a9de
4
+ data.tar.gz: a0a1683625c7fd6342974f4f00c53820c61d26a703110a61becafee2bf5f1b76
5
5
  SHA512:
6
- metadata.gz: 3509d3b59ed3c6f4d77e78ae8c105f1eb7301ff706857a817689d2da97f2e23ca0b7400d90cae961d0ec51d01a6bbe86c375e4ecc4322fb307cba18575ea473f
7
- data.tar.gz: 168f3b44c2db71af307c5dff9b2ad73858872093e6f0e22e41728b0c97d407e76e4bb56692a368800c840921749310a9bee6b869faed1b4f55ccd21737c54db7
6
+ metadata.gz: 6610c361726d1c670a35b6c92a6926995bddeb674fd4f1e19d7372fcb0b22d6c0de601b3681d9236c1764c6ae1ebebe56a6d0e144cc85442ea54712b0122d978
7
+ data.tar.gz: ef5fcd7fe3cbb1ca07ca8bb8e0e4b90b25092f1c6ecd261a1bd39670bd997a1847cbc8071513e57ae4b59cfb9b9069c1ab26863030677d840eb80b4517a54b0a
data/README.md CHANGED
@@ -110,7 +110,7 @@ those will be added to the `tags` key in the JSON document
110
110
 
111
111
  ## Why?
112
112
 
113
- On its own, `ActiveSupport::TaggedLogging` adds individual tags wrapped in squre brackets at the start of each line of log output. A configuration like
113
+ On its own, `ActiveSupport::TaggedLogging` adds individual tags wrapped in square brackets at the start of each line of log output. A configuration like
114
114
 
115
115
  ```ruby
116
116
  Rails.application.configure do
@@ -6,7 +6,7 @@ module JsonTaggedLogger
6
6
  attr_accessor :pretty_print
7
7
 
8
8
  def initialize(pretty_print: false)
9
- @pretty_pretty = pretty_print
9
+ @pretty_print = pretty_print
10
10
  end
11
11
 
12
12
  def call(severity, _time, _progname, message)
@@ -37,8 +37,7 @@ module JsonTaggedLogger
37
37
 
38
38
  log.merge!(parsed_message)
39
39
  else
40
- #binding.irb
41
- log.merge!(msg: parsed_message.strip)
40
+ log.merge!(msg: parsed_message.to_s.strip)
42
41
  end
43
42
  end
44
43
 
@@ -56,6 +55,8 @@ module JsonTaggedLogger
56
55
  tag = JSON.parse(t)
57
56
  rescue JSON::ParserError
58
57
  tag = t
58
+ rescue TypeError
59
+ tag = t.to_s
59
60
  ensure
60
61
  if tag.is_a?(Hash)
61
62
  json_tags << tag
@@ -3,8 +3,8 @@ require 'active_support/tagged_logging'
3
3
 
4
4
  module JsonTaggedLogger
5
5
  module Logger
6
- def self.new(logger)
7
- logger.formatter = Formatter.new
6
+ def self.new(logger, pretty_print: false)
7
+ logger.formatter = Formatter.new(pretty_print: pretty_print)
8
8
  ActiveSupport::TaggedLogging.new(logger)
9
9
  end
10
10
  end
@@ -1,3 +1,3 @@
1
1
  module JsonTaggedLogger
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_tagged_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Santry
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.3.20
118
+ rubygems_version: 3.5.6
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: JSON Tagged Log Formatter