chihiro 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/chihiro/flatten_util.rb +12 -0
- data/lib/chihiro/json_log_formatter.rb +3 -1
- data/lib/chihiro/loggable.rb +2 -0
- data/lib/chihiro/version.rb +1 -1
- data/lib/chihiro.rb +1 -0
- data/pkg/chihiro-0.3.11.gem +0 -0
- data/spec/flatten_util_spec.rb +22 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f3a7f945a807a2a39be4e4949d76fbdc50c81022ce8996b7e43fe39e2791086
|
4
|
+
data.tar.gz: 7f1de9e938be11ffa65fab760e3910b2a703cac2745f8b4852a929a863d9a4f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e2a771ad80db10e22aa5a1f975617871d495fa5263e1701c1ff2b361ee2dd0ac00d036ca1ca8e4694cfc978746914ea3113858d08dd66c626e63e387a26834
|
7
|
+
data.tar.gz: 3958e0bb63195360f668f298e1151151c6d9a1e18576adbe4c8b3130d40255c9835d9a8de1310df6e0019e8400adba3635953bfc0262cbec1fa50cc81860d6f9
|
data/Gemfile.lock
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'logger'
|
4
|
+
|
3
5
|
module Chihiro
|
4
6
|
class JsonLogFormatter < ::Logger::Formatter
|
5
7
|
def call(severity, _time, _progname, msg)
|
@@ -19,7 +21,7 @@ module Chihiro
|
|
19
21
|
|
20
22
|
def extra_log_data(msg)
|
21
23
|
if msg.is_a? Hash
|
22
|
-
MaskUtil.mask(msg)
|
24
|
+
FlattenUtil.flat(MaskUtil.mask(msg))
|
23
25
|
elsif msg.is_a? Exception
|
24
26
|
{ message: msg.message, backtrace: msg.backtrace }
|
25
27
|
else
|
data/lib/chihiro/loggable.rb
CHANGED
data/lib/chihiro/version.rb
CHANGED
data/lib/chihiro.rb
CHANGED
data/pkg/chihiro-0.3.11.gem
CHANGED
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Chihiro::FlattenUtil do
|
6
|
+
it 'should flat a nested hash' do
|
7
|
+
msg = {
|
8
|
+
password: '***',
|
9
|
+
message: 'abc',
|
10
|
+
aaa: {
|
11
|
+
password: '***',
|
12
|
+
other: 'otherMsg'
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
result = Chihiro::FlattenUtil.flat(msg)
|
17
|
+
|
18
|
+
expect(result).to eq({ password: '***',
|
19
|
+
message: 'abc',
|
20
|
+
aaa: "{:password=>\"***\", :other=>\"otherMsg\"}" })
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chihiro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shu Hui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lograge
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- bin/setup
|
98
98
|
- chihiro.gemspec
|
99
99
|
- lib/chihiro.rb
|
100
|
+
- lib/chihiro/flatten_util.rb
|
100
101
|
- lib/chihiro/initializer.rb
|
101
102
|
- lib/chihiro/json_log_formatter.rb
|
102
103
|
- lib/chihiro/loggable.rb
|
@@ -106,6 +107,7 @@ files:
|
|
106
107
|
- lib/generators/chihiro/templates/initializer.rb
|
107
108
|
- pkg/chihiro-0.3.11.gem
|
108
109
|
- spec/chihiro_spec.rb
|
110
|
+
- spec/flatten_util_spec.rb
|
109
111
|
- spec/mask_util_spec.rb
|
110
112
|
- spec/spec_helper.rb
|
111
113
|
homepage: https://github.com/blockchaintech-au/chihiro
|