resurfaceio-logger 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resurfaceio/base_logger.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e64df211f671ce6788896fe8810fbd7942700b42bf730b47b69c2d7f75add11b
|
4
|
+
data.tar.gz: 77f39e9cb57d693ce05ac3280e955137605de0fa13e3b4ada5041c3ff9dd21e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d345193859f6cba73a63757a3686b756837e697a034cdf416193c5de2b23cceabaf401af466ee4f98eaa1f709df608c7e6eb817d132e9141bf347ca6230eb61e
|
7
|
+
data.tar.gz: 88ffcade0c109fbf0a70e560b68824847f8467abd6fa9c4cef15a59eb0c83ffbcc78142e9c845b08a98cce40ac2826d2a566a03f6cd6e7fa8458ade8d83cbdbd
|
@@ -44,9 +44,11 @@ class BaseLogger
|
|
44
44
|
# validate url when present
|
45
45
|
unless @url.nil?
|
46
46
|
begin
|
47
|
-
|
47
|
+
@url_parsed = URI.parse(@url)
|
48
|
+
raise Exception unless @url_parsed.scheme.include?('http')
|
48
49
|
rescue Exception
|
49
50
|
@url = nil
|
51
|
+
@url_parsed = nil
|
50
52
|
@enabled = false
|
51
53
|
end
|
52
54
|
end
|
@@ -113,9 +115,8 @@ class BaseLogger
|
|
113
115
|
@submit_successes_lock.synchronize { @submit_successes += 1 }
|
114
116
|
else
|
115
117
|
begin
|
116
|
-
|
117
|
-
|
118
|
-
@url_connection.use_ssl = @url.include?('https')
|
118
|
+
url_connection = Net::HTTP.new(@url_parsed.host, @url_parsed.port)
|
119
|
+
url_connection.use_ssl = @url.include?('https')
|
119
120
|
request = Net::HTTP::Post.new(@url_parsed.path)
|
120
121
|
request.add_field('Content-Type', 'application/json; charset=UTF-8')
|
121
122
|
if @skip_compression
|
@@ -124,15 +125,14 @@ class BaseLogger
|
|
124
125
|
request.add_field('Content-Encoding', 'deflated')
|
125
126
|
request.body = Zlib::Deflate.deflate(msg)
|
126
127
|
end
|
127
|
-
response =
|
128
|
+
response = url_connection.request(request)
|
128
129
|
if response.code.to_i == 204
|
129
130
|
@submit_successes_lock.synchronize { @submit_successes += 1 }
|
130
131
|
else
|
131
132
|
@submit_failures_lock.synchronize { @submit_failures += 1 }
|
132
133
|
end
|
133
|
-
rescue
|
134
|
+
rescue Exception
|
134
135
|
@submit_failures_lock.synchronize { @submit_failures += 1 }
|
135
|
-
@url_connection = nil
|
136
136
|
end
|
137
137
|
end
|
138
138
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resurfaceio-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RobDickinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|