logjam_agent 0.38.0 → 0.38.1

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
  SHA256:
3
- metadata.gz: ca457f9e8f19c2915d63445f3c7f63bfccb4cc61d260b5e164cd80e5440c5659
4
- data.tar.gz: 2b58eeaa872b742b11faac8156354e551cce37c4dd15a33d594e2e05c794bbe9
3
+ metadata.gz: 47422acd5b4e45b015b0409e1c92cbe469fe883f6d7ae92eaa213434822f460c
4
+ data.tar.gz: 204958e60d5036f5d63c779b7af46dd2705aa6a0ba2be0145bb7c8780c72b849
5
5
  SHA512:
6
- metadata.gz: 0ca5aead4424e9cb01dfaf099f889a772099f3320173ba6af6d4d8aa80bd2972173cdfba69c8a3555f55caef723799871c916332b9e52b62ea516e941c7e6961
7
- data.tar.gz: 855bb281cfadd0485df1a2e2d2a446d502687ce03d35a5ab0fca80ad4d3a520296c1ff4650addc4c2a3149094a1834b897c1f8e2e7bc5efe5bdfb3fd4332b329
6
+ metadata.gz: b55dd07ab0d558ca83236a7971d7cd45116418b026ecf8bb9bc05fb435facd5896584f1f8f9d9e4cc657571001ed2613a4bbadcbd12c253af07cbf96fbba30bb
7
+ data.tar.gz: 53288566b7cb06d28a5129f71b4bc236569f0f259595ad14a603baa07085d93ebb25ac031e634096206409ec4b0da6b2d4e332f1ff8dfece3ddf89818eb01d23
@@ -122,6 +122,7 @@ module LogjamAgent
122
122
  when Hash
123
123
  message = LogjamAgent.json_encode_payload(message)
124
124
  else
125
+ message = message.to_s
125
126
  if request && severity >= Logger::ERROR && (e = detect_logged_exception(message))
126
127
  request.add_exception(e)
127
128
  end
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.38.0"
2
+ VERSION = "0.38.1"
3
3
  end
@@ -100,5 +100,22 @@ module LogjamAgent
100
100
  assert_match(/ERROR -- : RuntimeError\(murks\):(\n.*\.rb:\d+:in\s.*)+/, @device.lines.first)
101
101
  end
102
102
 
103
+ def test_can_log_arrays_as_text
104
+ LogjamAgent.log_format = :text
105
+ @logger.error([1, 2])
106
+ assert_equal 1, @lines.size
107
+ assert_equal([1, 2].to_s, @lines.first.last)
108
+ assert_equal 1, @device.lines.size
109
+ assert_match(/ERROR -- : \[1, 2\]\n/, @device.lines.first)
110
+ end
111
+
112
+ def test_can_log_arrays_as_json
113
+ LogjamAgent.log_format = :json
114
+ @logger.error([1, 2])
115
+ assert_equal 1, @lines.size
116
+ assert_equal([1, 2].to_s, @lines.first.last)
117
+ assert_equal 1, @device.lines.size
118
+ assert_match(/ERROR -- : \{"message":"\[1, 2\]"\}\n/, @device.lines.first)
119
+ end
103
120
  end
104
121
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.38.0
4
+ version: 0.38.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-25 00:00:00.000000000 Z
11
+ date: 2022-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake