fluent-plugin-gimbal-tranquility 0.4.0.t11 → 0.4.0.t20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fluent/tranquility/formatter.rb +4 -23
- data/lib/fluent/tranquility/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02f14def1ad674656a91e8a457f2027b15874916
|
4
|
+
data.tar.gz: bf2f3ac761f4fa8a151ac63a8fc056b9d235603e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f343f7f70ae9c75c0e6ef0070234e178de49039acdeaea9858539496e80b6a2ddda60ea7a7aeb76d966b7a2dd93c3b4fc33b2606bd7434466435b4da095d7ab6
|
7
|
+
data.tar.gz: 0f77605df9d43b46f47cd4bcd76d0b0039715da1d0d822fb815159d97cb523bd7d3a60fdf28f34bfdc046b90cb80dda2fcfa7ef56c75d9a74619d9fc7213b5e2
|
@@ -4,35 +4,16 @@ module Fluent
|
|
4
4
|
def call(_tag, _time, record)
|
5
5
|
begin
|
6
6
|
record.to_json + "\n"
|
7
|
-
rescue Encoding::UndefinedConversionError
|
8
|
-
# record.force_encoding("ASCII-8BIT").encode('UTF-8').to_json
|
7
|
+
rescue Encoding::UndefinedConversionError
|
9
8
|
puts
|
10
9
|
puts "@@@@@@"
|
11
|
-
puts
|
12
|
-
puts "Error: #{exc.message}\nRec: #{record}\nFixing..."
|
13
|
-
# record.encode('UTF-8', 'UTF-8').to_json + "\n"
|
14
|
-
|
15
|
-
|
10
|
+
puts record
|
16
11
|
record.each do |k, v|
|
17
|
-
|
18
|
-
record[k] = v.encode!(Encoding::UTF_8)
|
19
|
-
|
20
|
-
# if (v.respond_to?(:to_utf8))
|
21
|
-
# [ k, v.to_utf8 ]
|
22
|
-
# elsif (v.respond_to?(:encoding))
|
23
|
-
# [ k, v.dup.encode('UTF-8') ]
|
24
|
-
# else
|
25
|
-
# [ k, v ]
|
26
|
-
# end
|
27
|
-
|
28
|
-
# record[k] = v.encode('UTF-8', invalid: :replace, )
|
29
|
-
|
12
|
+
record[k] = v.force_encoding(Encoding::UTF_8)
|
30
13
|
end
|
31
|
-
|
32
|
-
puts "Fixed: #{record}"
|
14
|
+
puts record
|
33
15
|
puts "@@@@@@"
|
34
16
|
puts
|
35
|
-
|
36
17
|
return record.to_json + "\n"
|
37
18
|
end
|
38
19
|
end
|