ougai 1.5.8 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/ougai/formatters/bunyan.rb +5 -2
- data/lib/ougai/version.rb +1 -1
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f97b8ee5e0ea8a1a8447617bc897d7f4d74374ef
|
4
|
+
data.tar.gz: 6378c1a5f851471e1e57fd61595a9108d1cdfda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ef907639cb3aed26f0a363e6728e7a893c767d05a5e31dddb042c10c43996ef5ed1b5b1763843924ab10b2895e59db03e306bbdbd4881833c18689e4a7e0d88
|
7
|
+
data.tar.gz: b547e81ff137f3c877f1a789a22318b1172fa5743f24741f3ea2470309c9e8d0cc5f5d0f0257af74da5c5dd2a3451b223feec2296148db7bf3ce3eb2e705dd85
|
data/README.md
CHANGED
@@ -109,8 +109,8 @@ logger.debug('Debug!', custom_data: { id: 1, name: 'something' })
|
|
109
109
|
```
|
110
110
|
|
111
111
|
```json
|
112
|
-
{"name":"main","hostname":"mint","pid":14607,"level":20,"time":"2016-10-16T22:26:48.836+09:00","v":0,"msg":"Debugging","
|
113
|
-
{"name":"main","hostname":"mint","pid":14607,"level":20,"time":"2016-10-16T22:26:48.836+09:00","v":0,"msg":"Debug!","
|
112
|
+
{"name":"main","hostname":"mint","pid":14607,"level":20,"time":"2016-10-16T22:26:48.836+09:00","v":0,"msg":"Debugging","data_id":1,"data_flag":true}
|
113
|
+
{"name":"main","hostname":"mint","pid":14607,"level":20,"time":"2016-10-16T22:26:48.836+09:00","v":0,"msg":"Debug!","custom_data":{"id":1,"name":"something"}}
|
114
114
|
```
|
115
115
|
|
116
116
|
### log with a message and an exception
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'ougai/formatters/base'
|
2
|
-
require '
|
2
|
+
require 'oj'
|
3
3
|
|
4
4
|
module Ougai
|
5
5
|
module Formatters
|
@@ -47,10 +47,13 @@ module Ougai
|
|
47
47
|
|
48
48
|
private
|
49
49
|
|
50
|
+
OJ_OPTIONS = { mode: :custom, time_format: :xmlschema,
|
51
|
+
use_as_json: true, use_to_hash: true, use_to_json: true }
|
52
|
+
|
50
53
|
def dump(data)
|
51
54
|
return data unless @jsonize
|
52
55
|
data[:time] = format_datetime(data[:time])
|
53
|
-
str =
|
56
|
+
str = Oj.dump(data, OJ_OPTIONS)
|
54
57
|
str << "\n" if @with_newline
|
55
58
|
str
|
56
59
|
end
|
data/lib/ougai/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ougai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.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:
|
11
|
+
date: 2018-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: oj
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.4'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,17 +117,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
117
|
version: '0'
|
104
118
|
requirements: []
|
105
119
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.6.
|
120
|
+
rubygems_version: 2.6.13
|
107
121
|
signing_key:
|
108
122
|
specification_version: 4
|
109
123
|
summary: JSON logger compatible with node-bunyan is capable of handling structured
|
110
124
|
data easily.
|
111
125
|
test_files:
|
112
|
-
- spec/
|
126
|
+
- spec/formatters/base_spec.rb
|
127
|
+
- spec/formatters/bunyan_spec.rb
|
128
|
+
- spec/formatters/readable_spec.rb
|
113
129
|
- spec/child_logger_spec.rb
|
130
|
+
- spec/logging_spec.rb
|
114
131
|
- spec/logger_spec.rb
|
115
132
|
- spec/ougai_spec.rb
|
116
|
-
- spec/
|
117
|
-
- spec/formatters/bunyan_spec.rb
|
118
|
-
- spec/formatters/base_spec.rb
|
119
|
-
- spec/logging_spec.rb
|
133
|
+
- spec/spec_helper.rb
|