umbrellio-utils 0.6.1 → 0.6.2

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: e7b9db3034d4209600d582adc36279237c9a2134369ec5fc420ab6139bb17d7b
4
- data.tar.gz: 387d562e46ab37d01c09f02b4055da986d029249b74dcb855d4d2eedf8f87d71
3
+ metadata.gz: 3f9bf2d2029e95f5036e94891e9eb7880ccd3008a6276841edaa1eb4dc4a8c4d
4
+ data.tar.gz: 9e2b59f9badb3358751916847aef57345c6108dceb24001f559a6449593aaed8
5
5
  SHA512:
6
- metadata.gz: bdc5fe7e23ebcb5b4aabc008e042350a94ed4fafcfd41c27cfc44cafd1227f26023942fa0001d5643b4c7f67a09c7d6df1f4b8eb176679fdc0be6d97d847c79b
7
- data.tar.gz: 4814980dd7f7a5e1c7ed2734b6738847c067e503b53fd8327a603854a0033289b5372f0ae467c01282f5cdce9208869fe8cacdb29d794d6ccb21d897c86a6283
6
+ metadata.gz: 97bf35d68402b7ff28fbdd0f2b6ee6eae0e5267185640ca42639562fc3d1eb9dfe7874e0b8c969c989381476d76d8b0052f1b674ee5d367afedcc434ddf4e925
7
+ data.tar.gz: 47c973bda46d8a7f518a57be0a6f90e6177a2cb11037cc1af3aac487dd1cf03b75e4ec535560ddfdf8985824bbb6102d16c2aac7f3c69b06ee9d89949d71924d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umbrellio-utils (0.6.1)
4
+ umbrellio-utils (0.6.2)
5
5
  memery (~> 1)
6
6
 
7
7
  GEM
@@ -46,7 +46,7 @@ GEM
46
46
  racc (~> 1.4)
47
47
  nori (2.6.0)
48
48
  parallel (1.22.1)
49
- parser (3.2.0.0)
49
+ parser (3.2.1.0)
50
50
  ast (~> 2.4.1)
51
51
  pg (1.4.5)
52
52
  pry (0.14.2)
@@ -56,7 +56,7 @@ GEM
56
56
  rack (3.0.4.1)
57
57
  rainbow (3.1.1)
58
58
  rake (13.0.6)
59
- regexp_parser (2.6.2)
59
+ regexp_parser (2.7.0)
60
60
  rexml (3.2.5)
61
61
  rspec (3.12.0)
62
62
  rspec-core (~> 3.12.0)
@@ -70,18 +70,30 @@ module UmbrellioUtils
70
70
  log.level.upcase,
71
71
  log.name,
72
72
  thread_fingerprint_for(log),
73
- log.message,
73
+ log_to_message(log),
74
74
  log.tags,
75
75
  log.named_tags,
76
76
  log.time.utc.iso8601(9),
77
77
  ]
78
78
  end
79
79
 
80
- # Calculates MD5 fingerprint for the thread, in which the log was made.
80
+ # Calculates MD5 fingerprint for the thread in which the log was made.
81
81
  # @return [String] truncated `MD5` hash.
82
82
  def thread_fingerprint_for(log)
83
83
  Digest::MD5.hexdigest("#{log.thread_name}#{Process.pid}")[0...8]
84
84
  end
85
+
86
+ # Renders either exception or message of the log.
87
+ # @return [String]
88
+ def log_to_message(log)
89
+ if (e = log.exception)
90
+ msg = +"#{e.message} (#{e.class})"
91
+ msg << "\n#{e.backtrace.join("\n")}" if e.backtrace
92
+ msg
93
+ else
94
+ log.message
95
+ end
96
+ end
85
97
  end
86
98
  end
87
99
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UmbrellioUtils
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustAnotherDude
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-03 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memery
@@ -338,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  - !ruby/object:Gem::Version
339
339
  version: '0'
340
340
  requirements: []
341
- rubygems_version: 3.4.5
341
+ rubygems_version: 3.4.6
342
342
  signing_key:
343
343
  specification_version: 4
344
344
  summary: A set of utilities that speed up development