istox 0.1.66 → 0.1.67
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/istox.gemspec +1 -0
- data/lib/istox.rb +2 -0
- data/lib/istox/logging/hash_logging.rb +27 -0
- data/lib/istox/logging/log_formatter.rb +20 -0
- data/lib/istox/version.rb +1 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 521821a9c200ed635e2566632ca07539e3abdd01bec5320fb0b0eb7f4865bce2
|
4
|
+
data.tar.gz: ea237b283651ef6885b13cae392cbd5fe27ee7e1a8357df73c9aadea06a55a45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d37092798a3a63de395a3a7214acee390a168e4699f824e6a76afb2b81c1a91d2a5131df13b40465f5345881d9c2e5c476f03750fc7fe5e7aed3123f7e2473f1
|
7
|
+
data.tar.gz: 0266f50e0d96cc0df8a52329b81c701ca9d5ac8bfe13b83c467415029d703b45b3d71fa2c8c7172c5cc6014164f9cff64d26048b7ca965cae52dc66fbb5eaedf
|
data/istox.gemspec
CHANGED
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_dependency "paranoia", "~> 2.2"
|
39
39
|
spec.add_dependency "graphlient"
|
40
40
|
spec.add_dependency 'listen', '~> 3.0.5'
|
41
|
+
spec.add_dependency "binding_of_caller"
|
41
42
|
spec.add_development_dependency "bundler", "~> 1.16"
|
42
43
|
spec.add_development_dependency "rake", "~> 10.0"
|
43
44
|
spec.add_development_dependency "rspec", "~> 3.0"
|
data/lib/istox.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
module Istox
|
2
|
+
module Logging
|
3
|
+
module HashLogging
|
4
|
+
include ActiveSupport::TaggedLogging
|
5
|
+
|
6
|
+
def self.new(logger)
|
7
|
+
logger.formatter ||= ActiveSupport::Logger::SimpleFormatter.new
|
8
|
+
logger.formatter.extend Formatter
|
9
|
+
logger.extend(self)
|
10
|
+
end
|
11
|
+
|
12
|
+
module Formatter
|
13
|
+
include ActiveSupport::TaggedLogging::Formatter
|
14
|
+
|
15
|
+
def call(severity, timestamp, progname, msg)
|
16
|
+
tagged_message = case
|
17
|
+
when msg.is_a?(Hash) then tags_text.present? ? msg.merge(tags: tags_text) : msg
|
18
|
+
when tags_text.present? then { message: msg, tag: tags_text }
|
19
|
+
else msg
|
20
|
+
end
|
21
|
+
|
22
|
+
self.class.instance_method(:call).bind(self).call(severity, timestamp, progname, tagged_message)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Istox
|
3
|
+
module Logging
|
4
|
+
class LogFormatter
|
5
|
+
def call(severity, time, progname, msg='')
|
6
|
+
return '' if msg.blank?
|
7
|
+
return "timestamp='#{time}' level=#{severity} progname='#{progname}' #{processed_message(msg)}\n" if progname.present?
|
8
|
+
"timestamp='#{time}' level=#{severity} #{processed_message(msg)}\n"
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def processed_message(msg)
|
14
|
+
return msg.map { |k, v| "#{k}='#{v.strip}'" }.join(' ') if msg.is_a?(Hash)
|
15
|
+
|
16
|
+
"message='#{msg.strip}'"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 3.0.5
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: binding_of_caller
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: bundler
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -277,6 +291,8 @@ files:
|
|
277
291
|
- lib/istox/helpers/publisher.rb
|
278
292
|
- lib/istox/helpers/vault.rb
|
279
293
|
- lib/istox/interfaces/chainhub/transaction.rb
|
294
|
+
- lib/istox/logging/hash_logging.rb
|
295
|
+
- lib/istox/logging/log_formatter.rb
|
280
296
|
- lib/istox/migrations/create_blockchain_receipts.rb
|
281
297
|
- lib/istox/models/blockchain_receipt.rb
|
282
298
|
- lib/istox/models/concerns/blockchain_receipt_query.rb
|
@@ -300,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
316
|
version: '0'
|
301
317
|
requirements: []
|
302
318
|
rubyforge_project:
|
303
|
-
rubygems_version: 2.7.
|
319
|
+
rubygems_version: 2.7.8
|
304
320
|
signing_key:
|
305
321
|
specification_version: 4
|
306
322
|
summary: istox backend shared gem
|