appsignal 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGMwOWY4N2ZiMGY2OTAzNzcyYWFlZTU2NDUyOTBlYWZjZTI1Y2QxYw==
4
+ MmFjYTM5Y2QzMmQwOWUwNWU4NDY0YzViZmM4NWIzNTlmMTFmMWY5Nw==
5
5
  data.tar.gz: !binary |-
6
- YTk2MjQzMDNkZTdlMWQ4NDAyOWMxZTg4NjFhNWNlYzEwNzI2NjM3NA==
6
+ OWUxNDdlYTM5NTdkYmFhOTQ3NzViNWVjYWFmNTRlMDUxMGIzYmNiMQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjJhYzQxZWM1ZDEwMTFlYzMzNDZlZGI4MmU0NTJhOGY5YzY0MDBhNjhkZWE5
10
- MGMxNjQ4ODMwYTNlNDgzNTkyNDFhMTUzNmZhYzkzOGI2NGYxYWViNWJmZmQ2
11
- MTNiYjBiMWEzODBlODVlMTZmZGU0YTVhZDlhN2Y4MTEyMTRiZjY=
9
+ NWUwZGI2ZmUyODRhZDBlOTBmYzU1ZTQzMDM3YTNiN2M2NmRmMzk1MzUxYzRl
10
+ OWQ5MDU0Nzg4ZjQzZDc3YmQwOTMzNTU2NmVjMTdlYzg4NzgyYjA5MmIyZDk4
11
+ ZmJlMmQxNWUxMzBiOTdjY2I4YmNkM2FhMDE4OTkxMDAyN2JkZmI=
12
12
  data.tar.gz: !binary |-
13
- MDhhYWI1MWQ1YTJhYzY4ZTNhYmIwYmQ2Y2ZkZTMzYTI2ZWE0NjliMjEwNGE0
14
- ZGNkODcxYWU2ZTdiMzMzOTJlZTRkN2Y2NTllY2FmOGIxNzY0ODlkZDI2M2M0
15
- Njk2MTBkOWY0NDU5ZDJlZTI2MmEzNWI1OWIyNDIzODE1NTg2ZmM=
13
+ M2I3ZTM2MzMyMzkxMWFlY2RkODMxOWQ0ZmVjZjg4NTU2ZDI0YzU4NWRkMDYw
14
+ MTI0MjkyMDY1MWI3MDZkNzAzODI1ZmFkODExMDg3YTk2NzU2ZjE1NzAyYTJk
15
+ YmY1OTc3ODRlOThiMjQ3YTYxNmUxZjdhNDBmMzI0N2E4NzU2Mzg=
@@ -1,3 +1,8 @@
1
+ # 0.8.2
2
+ * Bugfix in Delayed Job integration
3
+ * appsignal prefix when logging to stdout
4
+ * Log to stdout on Shelly Cloud
5
+
1
6
  # 0.8.1
2
7
  * Fix in monitoring of queue times
3
8
 
@@ -94,11 +94,16 @@ module Appsignal
94
94
  end
95
95
 
96
96
  def start_logger(path)
97
- if path && File.writable?(path) && !ENV['DYNO']
97
+ if path && File.writable?(path) &&
98
+ !ENV['DYNO'] &&
99
+ !ENV['SHELLYCLOUD_DEPLOYMENT']
98
100
  @logger = Logger.new(File.join(path, 'appsignal.log'))
99
101
  @logger.formatter = Logger::Formatter.new
100
102
  else
101
103
  @logger = Logger.new($stdout)
104
+ @logger.formatter = lambda do |severity, datetime, progname, msg|
105
+ "appsignal: #{msg}\n"
106
+ end
102
107
  end
103
108
  @logger.level = Logger::INFO
104
109
  @logger << @in_memory_log.string if @in_memory_log
@@ -10,7 +10,7 @@ if defined?(::Delayed::Plugin)
10
10
  end
11
11
  end
12
12
 
13
- def self.invoke_with_instrumentation(job, &block)
13
+ def self.invoke_with_instrumentation(job, block)
14
14
  begin
15
15
  Appsignal::Transaction.create(SecureRandom.uuid, ENV.to_hash)
16
16
  class_name, method_name = job.name.split('#')
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.8.1'
2
+ VERSION = '0.8.2'
3
3
  end
@@ -54,7 +54,7 @@ describe "Delayed Job integration" do
54
54
  Appsignal::Transaction.any_instance.should_receive(:complete!)
55
55
 
56
56
  Timecop.freeze(time) do
57
- plugin.invoke_with_instrumentation(job, &invoked_block)
57
+ plugin.invoke_with_instrumentation(job, invoked_block)
58
58
  end
59
59
  end
60
60
  end
@@ -66,7 +66,7 @@ describe "Delayed Job integration" do
66
66
  Appsignal::Transaction.any_instance.should_receive(:complete!)
67
67
 
68
68
  lambda {
69
- plugin.invoke_with_instrumentation(job, &invoked_block)
69
+ plugin.invoke_with_instrumentation(job, invoked_block)
70
70
  }.should raise_error(StandardError)
71
71
  end
72
72
  end
@@ -173,7 +173,8 @@ describe Appsignal do
173
173
  before { Appsignal.start_logger(path) }
174
174
 
175
175
  it "should log to stdout" do
176
- out_stream.string.should include 'Log something'
176
+ Appsignal.logger.error('Log to stdout')
177
+ out_stream.string.should include 'appsignal: Log to stdout'
177
178
  end
178
179
  end
179
180
 
@@ -186,7 +187,22 @@ describe Appsignal do
186
187
  after { ENV.delete('DYNO') }
187
188
 
188
189
  it "should log to stdout" do
189
- out_stream.string.should include 'Log something'
190
+ Appsignal.logger.error('Log to stdout')
191
+ out_stream.string.should include 'appsignal: Log to stdout'
192
+ end
193
+ end
194
+
195
+ context "when we're on Shelly Cloud" do
196
+ let(:path) { File.join(project_fixture_path, 'log') }
197
+ before do
198
+ ENV['SHELLYCLOUD_DEPLOYMENT'] = 'true'
199
+ Appsignal.start_logger(path)
200
+ end
201
+ after { ENV.delete('SHELLYCLOUD_DEPLOYMENT') }
202
+
203
+ it "should log to stdout" do
204
+ Appsignal.logger.error('Log to stdout')
205
+ out_stream.string.should include 'appsignal: Log to stdout'
190
206
  end
191
207
  end
192
208
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-01-06 00:00:00.000000000 Z
15
+ date: 2014-01-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport