appsignal 1.1.5.beta.2 → 1.1.5.beta.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ce59be8afa0036d43feda6d0448b7f425331710
4
- data.tar.gz: fa7a0f18be1dc0bff11b6361df21af99dabca3bd
3
+ metadata.gz: 8ab24c0a488648acac563bdbf764376900b0d28b
4
+ data.tar.gz: 5458e8dbfbcc4a16a50c58eda06769c78eca10a8
5
5
  SHA512:
6
- metadata.gz: 4223ca5924dbe22903844f8231e55cf9676565b4516d2a4760945cacfb32b16ea235eb00d9ce18e621cf930665bf0212da029068058eea15a672f4b9a4188398
7
- data.tar.gz: 9a6c39eb3ca679bf9e3bda808dc67091b366f6c796a0fa7fc2c9d58265c34721e290e9453f94a26d72d14c1075250dc2f8810084676e0b59047fbfedd1c9d643
6
+ metadata.gz: 6d2f97e01145a80d25aede13c6679380feff0778b2ee3bd1e0433d6be0d08d819a847e26459db65bbaa83b88cebd50e575bc4cc50484db1b4e7645b0c7e3330b
7
+ data.tar.gz: 0bd95af4c2c48c75a27e47d4a14f4a4acc063afdd03ccb3b2da648510f343c25722b706faf8c3a9c7d19d3e360d4b6abedea0b467ce5a0e7e88e2f07498afaad
@@ -4,6 +4,7 @@
4
4
  * Warn when overwriting already existing transaction
5
5
  * Support for x86-linux
6
6
  * Some improvements in debug logging
7
+ * Check of log file path is writable
7
8
 
8
9
  # 1.1.4
9
10
  * Better debug logging for agent issues
@@ -207,9 +207,7 @@ module Appsignal
207
207
 
208
208
  def start_logger(path_arg=nil)
209
209
  path = Appsignal.config ? Appsignal.config.log_file_path : nil
210
- if path && File.writable?(File.dirname(path)) &&
211
- !ENV['DYNO'] &&
212
- !ENV['SHELLYCLOUD_DEPLOYMENT']
210
+ if path && !ENV['DYNO']
213
211
  @logger = Logger.new(path)
214
212
  @logger.formatter = log_formatter
215
213
  else
@@ -78,7 +78,11 @@ module Appsignal
78
78
 
79
79
  def log_file_path
80
80
  path = config_hash[:log_path] || root_path
81
- File.join(File.realpath(path), 'appsignal.log')
81
+ if File.writable?(path)
82
+ File.join(File.realpath(path), 'appsignal.log')
83
+ else
84
+ '/tmp/appsignal.log'
85
+ end
82
86
  rescue Errno::ENOENT
83
87
  '/tmp/appsignal.log'
84
88
  end
@@ -1,5 +1,5 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Appsignal
4
- VERSION = '1.1.5.beta.2'
4
+ VERSION = '1.1.5.beta.3'
5
5
  end
@@ -43,6 +43,14 @@ describe Appsignal::Config do
43
43
  its(:log_file_path) { should end_with('/tmp/appsignal.log') }
44
44
 
45
45
  context "if it is not writable" do
46
+ before { FileUtils.mkdir_p('/tmp/not-writable', :mode => 0555) }
47
+
48
+ let(:config) { project_fixture_config('production', :log_path => '/tmp/not-writable') }
49
+
50
+ its(:log_file_path) { should == '/tmp/appsignal.log' }
51
+ end
52
+
53
+ context "if it does not exist" do
46
54
  let(:config) { project_fixture_config('production', :log_path => '/non-existing') }
47
55
 
48
56
  its(:log_file_path) { should == '/tmp/appsignal.log' }
@@ -489,20 +489,6 @@ describe Appsignal do
489
489
  end
490
490
  end
491
491
 
492
- context "when we're on Shelly Cloud" do
493
- before do
494
- ENV['SHELLYCLOUD_DEPLOYMENT'] = 'true'
495
- end
496
- after { ENV.delete('SHELLYCLOUD_DEPLOYMENT') }
497
-
498
- it "should log to stdout" do
499
- Appsignal.start_logger
500
- Appsignal.logger.error('Log to stdout')
501
- out_stream.string.should include 'appsignal: Log to stdout'
502
- out_stream.string.should include 'Log something'
503
- end
504
- end
505
-
506
492
  context "when there is no in memory log" do
507
493
  it "should not crash" do
508
494
  Appsignal.in_memory_log = nil
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: 1.1.5.beta.2
4
+ version: 1.1.5.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-14 00:00:00.000000000 Z
12
+ date: 2016-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack