structured-event-logger 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTUxNWZjZjQyMTlhYjI2MjgyMjIwM2U4ZmI3MzM2MjkwMzQ0NzViMg==
4
+ OTA4MzBhODEyODA5ZDMwYmE1ZmU1NmYyZTVkYTI2YWY3NGYyY2EyOA==
5
5
  data.tar.gz: !binary |-
6
- YTk4YzRkYmRkOGM4Y2U3OWQ1OWMyMWE3NTVjYjlmMDU3YmI0NjAxMg==
7
- SHA512:
6
+ YmE3YzRlYTg0ZTQwZTg4NDYxZjBiZjQzYzU1ZDY4YzkwNjA3NGIzOA==
7
+ !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NmYzM2RiMWMxZDE2NTMyNzI4NTY5MTdiNmRmYjY5NjFmNzNiNTk4YTg2YTcw
10
- YmEyMzcxYzlhZWM3Y2I5MTdlMmExMTM0OWI3NTJjYWFiMDFiMzhlZmJjMzhi
11
- OTMxNTc2YWUwY2NiMmVmZWQxZTQ4NTA1MGFmY2U3NWM1NTM5NTE=
9
+ ODRjZTg4ZTBkZmRlMWYyNjE3ODFkYjgzNWFhYzU1ZTc1YTZhMDc2Y2UxNTkz
10
+ NDhkYzkyZDg4YjhhNzFhZDBkZDM3NDJiNGZlMGZmMjUzNDIyNzk1YmY5NTFh
11
+ OTkzM2M2OTgwYjJiYjQxOTEzZGZhM2U4MzdlYmQ1ZDk0NTlmMDk=
12
12
  data.tar.gz: !binary |-
13
- MzcyYmJmNWMyYTU0MmIyODE0ZTI5YTg0NjE3MmQyOGMwMmRlMmEyMDYwNzgy
14
- ODA1NmZlNDdkMDNiZjkzM2MxZTI0ZWEzMmEwNjMwNTAzYzBlM2MyNGIxNzlm
15
- NTBiMDZkYzNhOTI4ZTgxZTZjOWQwNzFlYWY4NWNiMWJmZjY4NWQ=
13
+ Njk0MTI3MzI3ODBjMGE5MDA1ODM1OTdkNzgzY2NhMjk4MmE4ZGY4ZjQyZTM5
14
+ Yzg0OWM3MzMzZWM1MjY5MTdhMzM2YWM5NDVjZDI1NGM4NWNlOGI4MWM0ZTY0
15
+ YmZhNmI5YjIyN2ZjNWI3ODIyZWJiMGJlMTAzN2M2ZDZjMjAxNjU=
@@ -67,6 +67,7 @@ class StructuredEventLogger
67
67
  end
68
68
 
69
69
  raise EventHandlingException.new(scope, event, exceptions) unless exceptions.empty?
70
+ record
70
71
  end
71
72
 
72
73
  def thread_key
@@ -1,3 +1,3 @@
1
1
  class StructuredEventLogger
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "rake"
26
26
  spec.add_development_dependency "minitest", "~> 5.0"
27
- spec.add_development_dependency "mocha"
27
+ spec.add_development_dependency "mocha", "~> 0.14"
28
28
  end
@@ -23,13 +23,19 @@ class StructuredEventLoggerTest < Minitest::Test
23
23
  end
24
24
 
25
25
  def test_should_log_event_to_both_loggers
26
- @event_logger.event "render", "error", {:status => "status", :message => "message"}
27
-
26
+ @event_logger.event("render", "error", {:status => "status", :message => "message"})
28
27
  assert_equal " [render] error: status=status, message=message\n", @nonstructured_io.string
29
28
  assert @json_io.string.end_with?("\n")
30
29
  assert_kind_of Hash, JSON.parse(@json_io.string)
31
30
  end
32
31
 
32
+ def test_should_return_event
33
+ event = @event_logger.event("render", "error", {:status => "status", :message => "message"})
34
+ json = JSON.parse(@json_io.string)
35
+ event = JSON.load(JSON.dump(event))
36
+ assert_equal event, json
37
+ end
38
+
33
39
  def test_default_json_properties
34
40
  @event_logger.event :render, :error
35
41
 
@@ -150,7 +156,7 @@ class StructuredEventLoggerTest < Minitest::Test
150
156
  def test_should_execute_a_custom_error_handler_on_failure
151
157
  @event_logger.endpoints[:failer1] = proc { raise "FAIL" }
152
158
  @event_logger.endpoints[:failer2] = proc { raise "FAIL" }
153
- @event_logger.error_handler = mock()
159
+ @event_logger.error_handler = mock('error handler')
154
160
  @event_logger.error_handler.expects(:call).with do |exception|
155
161
  assert_kind_of StructuredEventLogger::EventHandlingException, exception
156
162
  assert_equal 'Failed to submit the test/fail event to the following endpoints: failer1, failer2', exception.message
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structured-event-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emilie Noel
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-10-08 00:00:00.000000000 Z
14
+ date: 2013-12-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -87,16 +87,16 @@ dependencies:
87
87
  name: mocha
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - ! '>='
90
+ - - ~>
91
91
  - !ruby/object:Gem::Version
92
- version: '0'
92
+ version: '0.14'
93
93
  type: :development
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ! '>='
97
+ - - ~>
98
98
  - !ruby/object:Gem::Version
99
- version: '0'
99
+ version: '0.14'
100
100
  description: Structured event logging interface
101
101
  email:
102
102
  - willem@shopify.com
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.1.4
142
+ rubygems_version: 2.0.7
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Structured event logger that writes events to both a human readable log and
@@ -147,3 +147,4 @@ summary: Structured event logger that writes events to both a human readable log
147
147
  test_files:
148
148
  - test/structured_event_logger_test.rb
149
149
  - test/test_helper.rb
150
+ has_rdoc: