fluent-plugin-std-formatter 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.
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "fluent-plugin-std-formatter"
4
- gem.version = "0.0.1"
4
+ gem.version = "0.0.2"
5
5
  gem.authors = ["Alexey Panaetov"]
6
6
  gem.email = ["panaetovaa@gmail.com"]
7
7
  gem.description = %q{}
@@ -0,0 +1,27 @@
1
+ require 'fluent/formatter'
2
+
3
+ module Fluent
4
+ module TextFormatter
5
+ class IvideonLogsFormatter < Formatter
6
+ Plugin.register_formatter("formatter_std", self)
7
+
8
+ def format(tag, time, record)
9
+ if record["stack_trace"] == "None"
10
+ maybe_tb = ""
11
+ else
12
+ maybe_tb = "%s\n" % [record["stack_trace"]]
13
+ end
14
+
15
+ return "[%s][%s][%s][%s][pid=%s]: %s\n%s" % [
16
+ record["time_"],
17
+ record["level"],
18
+ record["host"],
19
+ record["module_"],
20
+ record["pid"],
21
+ record["raw"],
22
+ maybe_tb
23
+ ]
24
+ end
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-std-formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -40,8 +40,7 @@ files:
40
40
  - README.md
41
41
  - Rakefile
42
42
  - fluent-plugin-std-formatter.gemspec
43
- - lib/fluent/plugin/std/formatter.rb
44
- - lib/fluent/plugin/std/formatter/version.rb
43
+ - lib/fluent/plugin/formatter_std.rb
45
44
  homepage: ''
46
45
  licenses:
47
46
  - MIT
@@ -1,11 +0,0 @@
1
- require "fluent/plugin/std/formatter/version"
2
-
3
- module Fluent
4
- module Plugin
5
- module Std
6
- module Formatter
7
- # Your code goes here...
8
- end
9
- end
10
- end
11
- end
@@ -1,9 +0,0 @@
1
- module Fluent
2
- module Plugin
3
- module Std
4
- module Formatter
5
- VERSION = "0.0.1"
6
- end
7
- end
8
- end
9
- end