ougai 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2601a420b579e44bc84f8adf920737cb8b5b55aa17686ec915a5e7a84b30060b
4
- data.tar.gz: ad66b15e3c09200f04da050ecd0603bcdba398c4d8772a9a56091b52bfe2300c
3
+ metadata.gz: 768eb635909df00d19e850afcace9619451010b2ba622e2501babcbc0b03f20e
4
+ data.tar.gz: 0b89ea852a6dd204db6585a77a68bbc5fc9e36a8f3cc23c0b8c0f38c992894c0
5
5
  SHA512:
6
- metadata.gz: dcefccb0b74c4cc348afe5189674364cb948f66eea37617ab3ac9ddefa41ca9008d51443bc592c423d34fe7b17ee7c5a7b420adc066189e1f7f014e705247444
7
- data.tar.gz: 223ce77c55f3a7a5b043ee56fd37866bd1768d8d7df310369e45feeaede3aa47f223a4a59674a3363045d3f8df4e726c3a8ba29460c3457012671965e9c39a74
6
+ metadata.gz: 81e360fdffe1d371268dd0655ac07eb3d3c28c4acfe2042c13195391d70ff3f82871aea3a72633d9d7cf42749042ef677a1e75e9fe4c28dddbe47617db25a92f
7
+ data.tar.gz: e4110bd34b6da5dae6e56b7a5f28eefdc4bb2e2295b0090b3b958e9a43abf5136409e4312a2c71510380459d57ed88aa6128b9a22857bafc215b94ca182cb7f1
@@ -1,40 +1,42 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ougai (1.7.0)
4
+ ougai (1.7.1)
5
5
  oj (~> 3.4)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  awesome_print (1.8.0)
11
- diff-lcs (1.2.5)
12
- docile (1.1.5)
11
+ diff-lcs (1.3)
12
+ docile (1.3.1)
13
13
  json (2.1.0)
14
- oj (3.4.0)
14
+ json (2.1.0-java)
15
+ oj (3.7.4)
15
16
  rake (10.5.0)
16
- rspec (3.5.0)
17
- rspec-core (~> 3.5.0)
18
- rspec-expectations (~> 3.5.0)
19
- rspec-mocks (~> 3.5.0)
20
- rspec-core (3.5.4)
21
- rspec-support (~> 3.5.0)
22
- rspec-expectations (3.5.0)
17
+ rspec (3.8.0)
18
+ rspec-core (~> 3.8.0)
19
+ rspec-expectations (~> 3.8.0)
20
+ rspec-mocks (~> 3.8.0)
21
+ rspec-core (3.8.0)
22
+ rspec-support (~> 3.8.0)
23
+ rspec-expectations (3.8.2)
23
24
  diff-lcs (>= 1.2.0, < 2.0)
24
- rspec-support (~> 3.5.0)
25
- rspec-mocks (3.5.0)
25
+ rspec-support (~> 3.8.0)
26
+ rspec-mocks (3.8.0)
26
27
  diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.5.0)
28
- rspec-support (3.5.0)
29
- simplecov (0.14.1)
30
- docile (~> 1.1.0)
28
+ rspec-support (~> 3.8.0)
29
+ rspec-support (3.8.0)
30
+ simplecov (0.16.1)
31
+ docile (~> 1.1)
31
32
  json (>= 1.8, < 3)
32
33
  simplecov-html (~> 0.10.0)
33
- simplecov-html (0.10.1)
34
+ simplecov-html (0.10.2)
34
35
  timecop (0.9.1)
35
- yard (0.9.12)
36
+ yard (0.9.16)
36
37
 
37
38
  PLATFORMS
39
+ java
38
40
  ruby
39
41
 
40
42
  DEPENDENCIES
@@ -48,4 +50,4 @@ DEPENDENCIES
48
50
  yard
49
51
 
50
52
  BUNDLED WITH
51
- 1.16.1
53
+ 1.16.2
data/README.md CHANGED
@@ -355,6 +355,9 @@ logger.formatter = Ougai::Formatters::Readable.new
355
355
  - [Forward logs to Loggly](https://github.com/tilfin/ougai/wiki/Forward-logs-to-Loggly)
356
356
  - [Use as Rack logger](https://github.com/tilfin/ougai/wiki/Use-as-Rack-logger)
357
357
 
358
+ ## Custom formatters and integrations
359
+ - [Awesome Ougai](https://github.com/tilfin/ougai/wiki/Awesom-Ougai)
360
+
358
361
  ## License
359
362
 
360
363
  [MIT](LICENSE.txt)
@@ -7,6 +7,7 @@ module Ougai
7
7
 
8
8
  # @private
9
9
  def initialize(parent, fields)
10
+ @before_log = nil
10
11
  @parent = parent
11
12
  @with_fields = fields
12
13
  end
@@ -13,6 +13,7 @@ module Ougai
13
13
 
14
14
  def initialize(*args)
15
15
  super(*args)
16
+ @before_log = nil
16
17
  @default_message = 'No message'
17
18
  @exc_key = :err
18
19
  @with_fields = {}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ougai
4
- VERSION = '1.7.0'
4
+ VERSION = '1.7.1'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Ougai::Formatters::Readable do
4
- let!(:re_start_with_datetime) { /^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}(Z|[\+\-\:0-9]{4,6})]/ }
4
+ let!(:re_start_with_datetime) { /^\[\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}(Z|[\+\-\:0-9]{4,6})\]/ }
5
5
 
6
6
  let(:data) do
7
7
  {
@@ -40,11 +40,17 @@ describe Ougai::Logger do
40
40
  log_str = io.string
41
41
  begin
42
42
  JSON.parse(log_str, symbolize_names: true)
43
- rescue Exception => e
43
+ rescue Exception
44
44
  nil
45
45
  end
46
46
  end
47
47
 
48
+ class Dummy
49
+ def to_hash
50
+ { foo: 1 }
51
+ end
52
+ end
53
+
48
54
  shared_examples 'log' do
49
55
  context 'with message' do
50
56
  it 'outputs valid' do
@@ -130,12 +136,6 @@ describe Ougai::Logger do
130
136
 
131
137
  context 'with data that can respond to_hash' do
132
138
  it 'outputs valid' do
133
- class Dummy
134
- def to_hash
135
- { foo: 1 }
136
- end
137
- end
138
-
139
139
  logger.send(method, Dummy.new)
140
140
  expect(item).to be_log_message('No message', log_level)
141
141
  expect(item).to include_data(foo: 1)
@@ -586,7 +586,7 @@ describe Ougai::Logger do
586
586
  log_str = another_io.string
587
587
  begin
588
588
  JSON.parse(log_str, symbolize_names: true)
589
- rescue Exception => e
589
+ rescue Exception
590
590
  nil
591
591
  end
592
592
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ougai
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshimitsu Takahashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-24 00:00:00.000000000 Z
11
+ date: 2018-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.7.3
125
+ rubygems_version: 2.7.6
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: JSON logger compatible with node-bunyan or pino is capable of handling structured