loggregator_emitter 0.0.3.pre → 0.0.4.pre
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require "loggregator_messages"
|
2
2
|
require 'socket'
|
3
|
-
require "steno"
|
4
3
|
|
5
4
|
module LoggregatorEmitter
|
6
5
|
class Emitter
|
@@ -13,13 +12,13 @@ module LoggregatorEmitter
|
|
13
12
|
@source_type = source_type
|
14
13
|
end
|
15
14
|
|
16
|
-
def emit(
|
15
|
+
def emit(app_id, message)
|
17
16
|
s = UDPSocket.new
|
18
17
|
s.do_not_reverse_lookup = true
|
19
18
|
lm = LogMessage.new()
|
20
19
|
lm.timestamp = Time.now.to_i
|
21
20
|
lm.message = message
|
22
|
-
lm.app_id =
|
21
|
+
lm.app_id = app_id
|
23
22
|
lm.source_type = @source_type
|
24
23
|
lm.message_type = LogMessage::MessageType::OUT
|
25
24
|
|
data/loggregator_emitter.gemspec
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
require 'support/fake_loggregator_server'
|
2
2
|
require 'loggregator_emitter/emit'
|
3
|
-
require 'loggregator_emitter/target'
|
4
3
|
|
5
4
|
describe LoggregatorEmitter do
|
6
5
|
|
7
|
-
let(:target) { LoggregatorEmitter::Target.new('appId') }
|
8
|
-
|
9
6
|
describe 'configuring emitter' do
|
10
7
|
|
11
8
|
it 'can be configured' do
|
@@ -34,8 +31,8 @@ describe LoggregatorEmitter do
|
|
34
31
|
server = FakeLoggregatorServer.new(12345)
|
35
32
|
server.start
|
36
33
|
|
37
|
-
@emitter.emit(
|
38
|
-
@emitter.emit(
|
34
|
+
@emitter.emit("my_app_id", 'Hello there!')
|
35
|
+
@emitter.emit("my_app_id", 'Hello again!')
|
39
36
|
|
40
37
|
server.stop(2)
|
41
38
|
|
@@ -44,7 +41,7 @@ describe LoggregatorEmitter do
|
|
44
41
|
expect(messages.length).to eq 2
|
45
42
|
message = messages[0]
|
46
43
|
expect(message.message).to eq 'Hello there!'
|
47
|
-
expect(message.app_id).to eq
|
44
|
+
expect(message.app_id).to eq "my_app_id"
|
48
45
|
expect(message.source_type).to eq LogMessage::SourceType::CLOUD_CONTROLLER
|
49
46
|
|
50
47
|
message = messages[1]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loggregator_emitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.pre
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -91,7 +91,6 @@ files:
|
|
91
91
|
- Rakefile
|
92
92
|
- lib/loggregator_emitter.rb
|
93
93
|
- lib/loggregator_emitter/emit.rb
|
94
|
-
- lib/loggregator_emitter/target.rb
|
95
94
|
- loggregator_emitter.gemspec
|
96
95
|
- spec/loggregator_emitter/emit_spec.rb
|
97
96
|
- spec/support/fake_loggregator_server.rb
|