yell-adapters-gelf 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -4
- data/Gemfile +2 -1
- data/Rakefile +1 -21
- data/lib/yell/adapters/gelf.rb +9 -9
- data/spec/spec_helper.rb +2 -1
- data/spec/yell/adapters/gelf_spec.rb +47 -8
- data/yell-adapters-gelf.gemspec +2 -2
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d170e814b9f170402881a84e5c6ffd9a64c74796
|
4
|
+
data.tar.gz: befca3e31f26195a816fc2ce640695491843da3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82dd0d73817bebc6424feb5fc9f87d9a27d3671e2a04dd2f0fbc1b510a2efba5a55e558b399a9425b5f0f592f7dd3a0a2e13a884abe79a718dd4ac21a53c9bc3
|
7
|
+
data.tar.gz: af493d023d91b85c82f4bf79b57c2a725ae073c6806dca46d2362ac96df05da84f6633667c9c4f2cf56fdd5d18e867e2d2930838b17d20bfe2ec78a0e648cdcd
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,22 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'bundler'
|
4
|
-
Bundler::GemHelper.install_tasks
|
5
|
-
|
6
|
-
# === RSpec
|
7
|
-
begin
|
8
|
-
require 'rspec/core/rake_task'
|
9
|
-
|
10
|
-
desc "Run specs"
|
11
|
-
RSpec::Core::RakeTask.new do |t|
|
12
|
-
t.rspec_opts = %w(--color --format progress --order random)
|
13
|
-
t.ruby_opts = %w(-w)
|
14
|
-
end
|
15
|
-
rescue LoadError
|
16
|
-
task :spec do
|
17
|
-
abort "`gem install rspec` in order to run tests"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
task :default => :spec
|
1
|
+
require "bundler/gem_tasks"
|
22
2
|
|
data/lib/yell/adapters/gelf.rb
CHANGED
@@ -49,13 +49,13 @@ module Yell #:nodoc:
|
|
49
49
|
@sender = nil
|
50
50
|
@uid = 0
|
51
51
|
|
52
|
-
self.facility =
|
52
|
+
self.facility = Yell.__fetch__(options, :facility, :default => 'yell')
|
53
53
|
|
54
54
|
# initialize the UDP Sender
|
55
|
-
self.host =
|
56
|
-
self.port =
|
55
|
+
self.host = Yell.__fetch__(options, :host, :default => 'localhost')
|
56
|
+
self.port = Yell.__fetch__(options, :port, :default => 12201)
|
57
57
|
|
58
|
-
self.max_chunk_size =
|
58
|
+
self.max_chunk_size = Yell.__fetch__(options, :max_chunk_size, :default => :wan)
|
59
59
|
end
|
60
60
|
|
61
61
|
write do |event|
|
@@ -151,17 +151,17 @@ module Yell #:nodoc:
|
|
151
151
|
when Hash
|
152
152
|
message
|
153
153
|
when Exception
|
154
|
-
{
|
155
|
-
m.merge!(
|
154
|
+
{"short_message" => "#{message.class}: #{message.message}"}.tap do |m|
|
155
|
+
m.merge!("long_message" => message.backtrace.join("\n")) if message.backtrace
|
156
156
|
end
|
157
|
-
else {
|
157
|
+
else {"short_message" => message.to_s}
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
161
|
end
|
162
162
|
|
163
|
-
register(
|
164
|
-
register(
|
163
|
+
register(:gelf, Yell::Adapters::Gelf)
|
164
|
+
register(:graylog2, Yell::Adapters::Gelf)
|
165
165
|
|
166
166
|
end
|
167
167
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -27,22 +27,55 @@ describe Yell::Adapters::Gelf do
|
|
27
27
|
its(:max_chunk_size) { should == 1420 }
|
28
28
|
end
|
29
29
|
|
30
|
+
context :facility do
|
31
|
+
subject { adapter.facility }
|
32
|
+
|
33
|
+
context "from initialize options" do
|
34
|
+
let(:adapter) { Yell::Adapters::Gelf.new('facility' => 'facility') }
|
35
|
+
|
36
|
+
it { should == 'facility' }
|
37
|
+
end
|
38
|
+
|
39
|
+
context "from accessor" do
|
40
|
+
let(:adapter) { Yell::Adapters::Gelf.new }
|
41
|
+
before { adapter.facility = 'facility' }
|
42
|
+
|
43
|
+
it { should == 'facility' }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
30
47
|
context :host do
|
31
|
-
let(:adapter) { Yell::Adapters::Gelf.new }
|
32
48
|
subject { adapter.host }
|
33
49
|
|
34
|
-
|
50
|
+
context "from initialize options" do
|
51
|
+
let(:adapter) { Yell::Adapters::Gelf.new('host' => 'hostname') }
|
52
|
+
|
53
|
+
it { should == 'hostname' }
|
54
|
+
end
|
55
|
+
|
56
|
+
context "from accessor" do
|
57
|
+
let(:adapter) { Yell::Adapters::Gelf.new }
|
58
|
+
before { adapter.host = 'hostname' }
|
35
59
|
|
36
|
-
|
60
|
+
it { should == 'hostname' }
|
61
|
+
end
|
37
62
|
end
|
38
63
|
|
39
64
|
context :port do
|
40
|
-
let(:adapter) { Yell::Adapters::Gelf.new }
|
41
65
|
subject { adapter.port }
|
42
66
|
|
43
|
-
|
67
|
+
context "from initialize options" do
|
68
|
+
let(:adapter) { Yell::Adapters::Gelf.new('port' => 1234) }
|
69
|
+
|
70
|
+
it { should == 1234 }
|
71
|
+
end
|
72
|
+
|
73
|
+
context "from accessor" do
|
74
|
+
let(:adapter) { Yell::Adapters::Gelf.new }
|
75
|
+
before { adapter.port = 1234 }
|
44
76
|
|
45
|
-
|
77
|
+
it { should == 1234 }
|
78
|
+
end
|
46
79
|
end
|
47
80
|
|
48
81
|
context :max_chunk_size do
|
@@ -59,7 +92,7 @@ describe Yell::Adapters::Gelf do
|
|
59
92
|
it { should == 8154 }
|
60
93
|
end
|
61
94
|
|
62
|
-
context
|
95
|
+
context 'other'do
|
63
96
|
before { adapter.max_chunk_size = "1234" }
|
64
97
|
it { should == 1234 }
|
65
98
|
end
|
@@ -88,7 +121,13 @@ describe Yell::Adapters::Gelf do
|
|
88
121
|
end
|
89
122
|
|
90
123
|
it "should be zipped" do
|
91
|
-
|
124
|
+
expected = "\x78\x9c" # zlib header
|
125
|
+
|
126
|
+
if RUBY_VERSION[0, 1].to_i >= 2
|
127
|
+
expected = expected.b
|
128
|
+
end
|
129
|
+
|
130
|
+
datagrams[0][0..1].should == expected
|
92
131
|
end
|
93
132
|
end
|
94
133
|
|
data/yell-adapters-gelf.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "yell-adapters-gelf"
|
5
|
-
s.version = "2.0.
|
5
|
+
s.version = "2.0.1"
|
6
6
|
s.authors = ["Rudolf Schmidt"]
|
7
7
|
|
8
8
|
s.homepage = "http://rubygems.org/gems/yell"
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_runtime_dependency "yell", "
|
20
|
+
s.add_runtime_dependency "yell", ">= 2.0.4", "< 3"
|
21
21
|
s.add_runtime_dependency "json"
|
22
22
|
end
|
23
23
|
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yell-adapters-gelf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rudolf Schmidt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yell
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.4
|
20
|
+
- - <
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
22
|
+
version: '3'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.4
|
30
|
+
- - <
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '3'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: json
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
80
|
version: '0'
|
75
81
|
requirements: []
|
76
82
|
rubyforge_project: yell
|
77
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.2.2
|
78
84
|
signing_key:
|
79
85
|
specification_version: 4
|
80
86
|
summary: Yell - Your Extensible Logging Library
|