tracer_client 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +10 -0
- data/lib/tracer_client.rb +1 -0
- data/lib/tracer_client/log.rb +2 -1
- data/lib/tracer_client/server.rb +2 -2
- data/lib/tracer_client/version.rb +1 -1
- data/tracer_client.gemspec +5 -4
- metadata +25 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 27e8a38c35fbc109f95ba7c54fac9bf0c65ff8ea905a19fe7e5a1a3349142bfa
|
4
|
+
data.tar.gz: 9db1743872444e3c627edc9fb0316e70418c82e793188814c28985ff5ed47f9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fc14f7cef21d4a2d81d5957e73cdefac8a28b814d5e119cfce291c81d64e1295e8a4508f0d9f725c1f8eab17587fa6a6b6b319faebbf6971b6d913b32657976
|
7
|
+
data.tar.gz: 8cbbf8218a0c5a767c75c98676bf304defd1ba4d534a930ba637a0418ef1dc96f55045b8df16a5fd90dbad5aa9972615deb4622d0af59a21c894d1d25470368e
|
data/README.md
CHANGED
@@ -46,6 +46,16 @@ rescue => e
|
|
46
46
|
end
|
47
47
|
```
|
48
48
|
|
49
|
+
To cancel sending log messages in production mode you should use the environment variable NO_TRACER with a truthy value (true, TRUE, 1, etc).
|
50
|
+
```ruby
|
51
|
+
ENV['NO_TRACER'] - true
|
52
|
+
```
|
53
|
+
|
54
|
+
In a development mode sending messages is disabled by default. Sending messages can be re-enabled using a TRACER environment variable with a truthy value.
|
55
|
+
```ruby
|
56
|
+
ENV['TRACER'] - true
|
57
|
+
```
|
58
|
+
|
49
59
|
## Development
|
50
60
|
|
51
61
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/tracer_client.rb
CHANGED
data/lib/tracer_client/log.rb
CHANGED
@@ -132,7 +132,8 @@ module Log
|
|
132
132
|
|
133
133
|
|
134
134
|
def self.log?(severity)
|
135
|
-
|
135
|
+
(Rails.env.production? && !ENV['NO_TRACER'].to_b || ENV['TRACER'].to_b) &&
|
136
|
+
(Settings.log.severity_level.nil? || enabled_severity?(severity, Settings.log.severity_level))
|
136
137
|
end
|
137
138
|
|
138
139
|
def self.enabled_severity?(message_severity, configured_severity)
|
data/lib/tracer_client/server.rb
CHANGED
@@ -4,7 +4,7 @@ module Tracer
|
|
4
4
|
module Server
|
5
5
|
|
6
6
|
def self.log(notice_hash)
|
7
|
-
send("http://#{Settings.tracer.host}:#{Settings.tracer.port}/api/v3/
|
7
|
+
send("http://#{Settings.tracer.host}:#{Settings.tracer.port}/api/v3/project/#{Settings.tracer.project}/notices?api_key=#{Settings.tracer.api_key}", notice_hash)
|
8
8
|
end
|
9
9
|
|
10
10
|
|
@@ -33,4 +33,4 @@ module Tracer
|
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
data/tracer_client.gemspec
CHANGED
@@ -19,9 +19,10 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_dependency 'config', '
|
23
|
-
spec.add_dependency 'rails', '
|
22
|
+
spec.add_dependency 'config', '>= 1.0'
|
23
|
+
spec.add_dependency 'rails', '>= 5.0'
|
24
|
+
spec.add_dependency 'wannabe_bool', '>= 0.7'
|
24
25
|
|
25
|
-
spec.add_development_dependency 'bundler', '
|
26
|
-
spec.add_development_dependency 'rake', '
|
26
|
+
spec.add_development_dependency 'bundler', '>= 1.10'
|
27
|
+
spec.add_development_dependency 'rake', '>= 10.0'
|
27
28
|
end
|
metadata
CHANGED
@@ -1,69 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracer_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serge Galanin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: config
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '5.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: wannabe_bool
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.7'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.7'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - "
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: '1.10'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - "
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '1.10'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - "
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '10.0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - "
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '10.0'
|
69
83
|
description: Log errors and objects changes to Tracer.
|
@@ -117,8 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
131
|
- !ruby/object:Gem::Version
|
118
132
|
version: '0'
|
119
133
|
requirements: []
|
120
|
-
|
121
|
-
rubygems_version: 2.6.11
|
134
|
+
rubygems_version: 3.0.6
|
122
135
|
signing_key:
|
123
136
|
specification_version: 4
|
124
137
|
summary: Tracer API
|