imprint 1.4.3.pre5 → 1.4.3.pre6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/imprint/tracer.rb +8 -4
- data/lib/imprint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d075f248eb20771b334854e0b770ab22a2f2363
|
4
|
+
data.tar.gz: 873b75c811892b158dd29c4fef5a3bd3ac9d1f98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a479545dc24eca094b0a1958574621abe8a786c0a31baaa1a7fd9b5dddb285a3e2e374e0dbbf532a2538a2661c6db3c1b9257ba6698e42351377f5ab5b44626
|
7
|
+
data.tar.gz: ce7d5568689a2149868612290f09a0f15f64c0cca08f98d739fe6ec81796680b091925ea81ed879388c7c7796b44a4af7a8972e2dcd82a67b7926a09a52ddbad
|
data/lib/imprint/tracer.rb
CHANGED
@@ -8,7 +8,7 @@ module Imprint
|
|
8
8
|
TRACE_CHARS = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten
|
9
9
|
|
10
10
|
def self.set_trace_id(id, rack_env = {})
|
11
|
-
|
11
|
+
Thread.current[TRACER_TIMESTAMP] = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%S.%6N")
|
12
12
|
Thread.current[TRACER_KEY] = id
|
13
13
|
# setting to the rack_env, gives error tracking support in some systems
|
14
14
|
rack_env[TRACER_KEY] = id
|
@@ -23,7 +23,11 @@ module Imprint
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.get_trace_timestamp
|
26
|
-
|
26
|
+
Time.now.utc.strftime("%Y-%m-%dT%H:%M:%S.%6N")
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.get_pid
|
30
|
+
"#{$$}"
|
27
31
|
end
|
28
32
|
|
29
33
|
def self.insert_trace_id_in_message(message, severity = nil)
|
@@ -31,8 +35,8 @@ module Imprint
|
|
31
35
|
trace_id = get_trace_id
|
32
36
|
|
33
37
|
if trace_id && trace_id != TRACE_ID_DEFAULT
|
34
|
-
message.insert 0, "
|
35
|
-
message.gsub!("\n"," trace_id=#{trace_id}\n")
|
38
|
+
message.insert 0, "log_time=#{get_trace_timestamp} log_level=#{severity} "
|
39
|
+
message.gsub!("\n"," process_pid=#{get_pid} trace_id=#{trace_id}\n")
|
36
40
|
end
|
37
41
|
end
|
38
42
|
end
|
data/lib/imprint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imprint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.3.
|
4
|
+
version: 1.4.3.pre6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|