service_skeleton 0.0.0.29.g23642ab → 0.0.0.30.g32b8169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e4a97db2426d2ff3e0227a1cedd25c32f633d1c3510cefd2c0b14e19c1e81d6
4
- data.tar.gz: ffc34a323ac4e1efeaeda131e1832130591f90fdc44c4ae90d762da3082cbbc4
3
+ metadata.gz: c73ba4e02f8bcd6f90caa188e15b3da3bd3fef747a30f8da70ac12881177c179
4
+ data.tar.gz: a1e1f008182f70f135c7455725d2e1bf4a7515789512786b2aa58c914bed9299
5
5
  SHA512:
6
- metadata.gz: 4065ad55c0c34d94bb24ebf6f96b4b3fdd9c310d8fac3608020ac94b4e0e65e5d5254e1a95807a6653af4e019544d28cc732b8a489465a05c6c2e4c1a342b04a
7
- data.tar.gz: ab8728d49ece71d506550d42e03c7e5e7a953f7acf16aabfb8c723836835e4d1d94d554ee4a42c5c6b825368b509da33accf5bab2265181e235d16236419abf1
6
+ metadata.gz: ee7d4bb7bb7f1b84f37fb3d63bc698e632dcad00eaa98e886628106d3966d57ce950499696ea04628fb09f8e1de9b6242069486fc0669be2413278dcf6c8f744
7
+ data.tar.gz: 5d75bab29a82cd40083fde69a2d9725273475a45e922d68e2b3b88300215fc3ec0dfea08fa441556235fe48a0879fe5cbff037cf407debd9a3efd5f2710c18aa
@@ -62,10 +62,20 @@ class ServiceSkeleton
62
62
  loggerstash.attach(@logger)
63
63
  end
64
64
 
65
- if log_enable_timestamps
66
- @logger.formatter = ->(s, t, p, m) { "#{t.utc.strftime("%FT%T.%NZ")} #{s[0]} [#{p}] #{m}\n" }
65
+ thread_id_map = {}
66
+ if Thread.main
67
+ thread_id_map[Thread.main.object_id] = 0
67
68
  else
68
- @logger.formatter = ->(s, t, p, m) { "#{s[0]} [#{p}] #{m}\n" }
69
+ #:nocov:
70
+ thread_id_map[Thread.current.object_id] = 0
71
+ #:nocov:
72
+ end
73
+
74
+ @logger.formatter = ->(s, t, p, m) do
75
+ th_n = thread_id_map[Thread.current.object_id] || (thread_id_map[Thread.current.object_id] = thread_id_map.length)
76
+
77
+ ts = log_enable_timestamps ? "#{t.utc.strftime("%FT%T.%NZ")} " : ""
78
+ "#{ts}##{th_n} #{s[0]} [#{p}] #{m}\n"
69
79
  end
70
80
 
71
81
  @logger.filters = []
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_skeleton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.29.g23642ab
4
+ version: 0.0.0.30.g32b8169
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-18 00:00:00.000000000 Z
11
+ date: 2019-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: frankenstein