vx-lib-instrumentation 0.1.10 → 0.1.11

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
  SHA1:
3
- metadata.gz: 87fad168a70793f3eba1529c497dd9a07ced8cba
4
- data.tar.gz: 2d86e6061be4db7ef01d35726c198cc5252a829c
3
+ metadata.gz: ffcca3384777b519cd65b0a9f92218be25e8e546
4
+ data.tar.gz: fe5568c440ae31cd4b1b54746295db11ca766765
5
5
  SHA512:
6
- metadata.gz: 7ddaaf67662933868433be012b68644789df22168c0ffa47a571a782758161fbc408236092dcc24f51f91fa9345e3229e525a1fa6f6c9869095a8c0fac81dd0e
7
- data.tar.gz: 13c4e2ec06f58495d93a7a1ba50763faeb83c1739acf69d00845573144cb2ca6f6fd1f2463975a012fa0f5e49c129b1e211ce5fdc81a82f935d8f095c40a698e
6
+ metadata.gz: d3387b7c835cb6d29edb97e0084b190ae418e3486dcaf7d24e3725af1d92d93709e564e828195aa9dd08ccfd5956166449a29570bfdbbf8f50c1724eb4f9d83c
7
+ data.tar.gz: 44a09daa2de42c0369e87bc5e558a8212468129272aafb797c6887409ccb36e9f0b1889ddf575a8a09a6a3b5d7447ead1d41b974520c37a59ce1b7f789472321
@@ -1,3 +1,3 @@
1
1
  module Vx ; module Lib ; module Instrumentation
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end ; end ; end
@@ -14,6 +14,12 @@ module Vx ; module Lib ; module Instrumentation
14
14
 
15
15
  extend self
16
16
 
17
+ @@app_name = nil
18
+
19
+ def app_name
20
+ @@app_name
21
+ end
22
+
17
23
  def root
18
24
  File.expand_path("../", __FILE__)
19
25
  end
@@ -24,8 +30,12 @@ module Vx ; module Lib ; module Instrumentation
24
30
  end
25
31
  end
26
32
 
27
- def install(target, log_level = 0)
33
+ def install(target, options = {})
28
34
  $stdout.puts " --> activate Vx::Instrumentation, log stored in #{target}"
35
+
36
+ log_level = options[:log_level] || 0
37
+ @@app_name = options[:app_name] || 'default'
38
+
29
39
  Lib::Instrumentation::Logger.setup target
30
40
  Lib::Instrumentation::Logger.logger.level = log_level
31
41
  end
@@ -54,6 +64,7 @@ module Vx ; module Lib ; module Instrumentation
54
64
  "@timestamp" => Time.now.strftime(DATE_FORMAT),
55
65
  "@tags" => tags,
56
66
  "@fields" => env,
67
+ app_name: app_name,
57
68
  process_id: Process.pid,
58
69
  thread_id: Thread.current.object_id,
59
70
  exception: ex.class.to_s,
@@ -69,12 +80,13 @@ module Vx ; module Lib ; module Instrumentation
69
80
  Lib::Instrumentation::Logger.logger.log(
70
81
  ::Logger::INFO,
71
82
  "@event" => name,
72
- process_id: Process.pid,
73
- thread_id: Thread.current.object_id,
74
83
  "@timestamp" => started.strftime(DATE_FORMAT),
75
84
  "@duration" => (finished - started).to_f,
76
85
  "@fields" => payload,
77
- "@tags" => tags
86
+ "@tags" => tags,
87
+ process_id: Process.pid,
88
+ thread_id: Thread.current.object_id,
89
+ app_name: app_name
78
90
  )
79
91
  end
80
92
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-lib-instrumentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky