civo-logger 0.1.6 → 0.1.7

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: f3616e6e1d6c85fa0984f046ec624d714fea397d
4
- data.tar.gz: 273f69752d28267843e5560dc3b2795f76a0877b
3
+ metadata.gz: ae3071165ff9f245f8f8dec0d2488d6191fec750
4
+ data.tar.gz: 07cee876d0c01326c028c03ca472730821ed12a0
5
5
  SHA512:
6
- metadata.gz: 5a56aedeac75628ef3316ca50c9eddcdee1ded6398c4ddebd36b52bd291bf7c3ecad0f7c62b05f144c7f3f2d9adff4ec30ce7af8368a3898b738eb957e129a90
7
- data.tar.gz: 64905ef0e66897d2db7994b92398ce4f353b9d1e2b8811635508e3fb60d07babb1a23cb89695c0e2d96396f07238c3bd9dcd95ffb2b33f5de6c5fc5df76c7f5b
6
+ metadata.gz: 1bdd7070b760d04209872c47f825a234df1b4d9c07909e2f56eeafc3da668bbc533d5c37394ddccb76545177d9ae6a83a22b04e39c01c238c60691422957dafb
7
+ data.tar.gz: ada5038f5fbfe9c42aa1534fb8d73c4aa91246469b625415aad33e974298d35d0359ff44ad562697d16e278f70c81086bb383161b24985fd0a6fc780d419a90b
@@ -127,7 +127,6 @@ module Civo
127
127
  instrumenter.start "request.action_dispatch", request: request
128
128
  logger.info { started_request_message(request) }
129
129
  status, headers, body = @app.call(env)
130
- body = body.to_a rescue [body.body]
131
130
  finish(request, body)
132
131
  [status, headers, body]
133
132
  rescue Exception => e
@@ -164,17 +163,19 @@ module Civo
164
163
  instrumenter.finish "request.action_dispatch", request: request
165
164
  @log = @lines.join("\n")
166
165
 
167
- if body.respond_to?(:each)
168
- @output = []
169
- body.each do |line|
170
- @output << line
166
+ if send_request?(request)
167
+ body = body.to_a rescue [body.body]
168
+
169
+ if body.respond_to?(:each)
170
+ @output = []
171
+ body.each do |line|
172
+ @output << line
173
+ end
174
+ @output = @output.join("\n")
175
+ else
176
+ @output = body.to_s
171
177
  end
172
- @output = @output.join("\n")
173
- else
174
- @output = body.to_s
175
- end
176
178
 
177
- if send_request?(request)
178
179
  @redis.set("#{app_name}:log:#{@key}", @log[0, 65535], expires_in: 1.hour)
179
180
  @redis.set("#{app_name}:log-output:#{@key}", @output, expires_in: 1.hour)
180
181
 
@@ -1,5 +1,5 @@
1
1
  module Civo
2
2
  module Logger
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: civo-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-06 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler