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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d005710da7678175d682d62115fefbc5fb96ddfd1270d198fe07c68a0b8fc16f
4
- data.tar.gz: d19cae6ce46df4bc981d26195b6d9880006f981ad9f5cab3a69d0273c85b262e
3
+ metadata.gz: 521821a9c200ed635e2566632ca07539e3abdd01bec5320fb0b0eb7f4865bce2
4
+ data.tar.gz: ea237b283651ef6885b13cae392cbd5fe27ee7e1a8357df73c9aadea06a55a45
5
5
  SHA512:
6
- metadata.gz: e721e1f818aeb1e6ec2c4d54a955fcc8f09213044a8491d0a66caf933a29644db55e717746a9f6523309eeeacd0f781ce82a0d1a6b250d1bce48b850f780a493
7
- data.tar.gz: 24e690a7e54c4302fa7a456413399b8e0356bbee7195136c989e8563274a859fb79da930db3d2457db14084014762f312bbba940820f00655fcf4dedb5031dad
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
@@ -27,4 +27,6 @@ module Istox
27
27
  require "istox/consumers/blockchain_status_handler"
28
28
  require "istox/consumers/blockchain_hash_handler"
29
29
  require "istox/migrations/create_blockchain_receipts"
30
+ require "istox/logging/hash_logging"
31
+ require "istox/logging/log_formatter"
30
32
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = "0.1.66"
2
+ VERSION = "0.1.67"
3
3
  end
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.66
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-10 00:00:00.000000000 Z
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.7
319
+ rubygems_version: 2.7.8
304
320
  signing_key:
305
321
  specification_version: 4
306
322
  summary: istox backend shared gem