fluent-plugin-color-stripper 0.0.1 → 0.0.2
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 +4 -4
- data/fluent-plugin-color-stripper.gemspec +1 -1
- data/lib/fluent/plugin/out_color_stripper.rb +4 -0
- data/test/test_color_stripper.rb +10 -0
- 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: d99837a88f38b1e42b970d805933ecbb918b4a2f
|
4
|
+
data.tar.gz: 1c86e20cb533ecd35d04919cd62a640bc8889a7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2130c6fa0925a6a53620b0cdb7ee835349135680cebb83a58a9d39ba5517467069b69be97fc9a8af5e996d7e4c2fd6288cd81288fbe02ae6b6916bc0f0605297
|
7
|
+
data.tar.gz: e44c37730a8b666ef514a8d1094321bd4103859a9deb30acc61ab9d8344a301d75ddb798b8b16b7a21c7ecb2ef7938197b52fa3dc41ea5d0ad4949155f7a5182
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-color-stripper"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.2"
|
8
8
|
spec.authors = ["Matthew O'Riordan"]
|
9
9
|
spec.email = ["matt@ably.io "]
|
10
10
|
spec.description = %q{Output plugin to strip ANSI color codes in the logs.}
|
@@ -2,10 +2,14 @@ module Fluent
|
|
2
2
|
class ColorStripperOutput < Output
|
3
3
|
Fluent::Plugin.register_output('color_stripper', self)
|
4
4
|
|
5
|
+
config_param :tag, :string
|
5
6
|
config_param :strip_fields, :string, default: nil
|
6
7
|
|
7
8
|
def configure(conf)
|
8
9
|
super
|
10
|
+
|
11
|
+
@tag = conf.fetch('tag') { raise ArgumentError, 'tag field is required to direct transformed logs to' }
|
12
|
+
|
9
13
|
@strip_fields_arr = conf['strip_fields'].to_s.split(/\s*,\s*/).map do |field|
|
10
14
|
field unless field.strip.empty?
|
11
15
|
end.compact
|
data/test/test_color_stripper.rb
CHANGED
@@ -57,4 +57,14 @@ class ColorStripperOutputTest < Test::Unit::TestCase
|
|
57
57
|
}
|
58
58
|
], d1.records
|
59
59
|
end
|
60
|
+
|
61
|
+
def test_missing_tag
|
62
|
+
err = assert_raises Fluent::ConfigError do
|
63
|
+
create_driver %[
|
64
|
+
type color_stripper
|
65
|
+
]
|
66
|
+
end
|
67
|
+
|
68
|
+
assert_match /tag.*required/, err.message
|
69
|
+
end
|
60
70
|
end
|