mamiya 0.0.1.alpha5 → 0.0.1.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mamiya/cli.rb +8 -12
- data/lib/mamiya/logger.rb +1 -0
- data/lib/mamiya/version.rb +1 -1
- data/spec/logger_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0f7a6c651243bbb6688a23b99f6a227b9f43100
|
4
|
+
data.tar.gz: db21e18cb16baad91bb16fef86b5c764d8f395b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 228af2b0c3e35452f515868590cde85131b79818a0b0e2c174a23e89adad56cd9ae03d3fb30aef16fbb0656dbfd581ad4b4113bc00c3dcca2d656605f8c95236
|
7
|
+
data.tar.gz: 7eb0f6684de2155783e43ed516217fc5743ebdb01b708e0dc30e32e01fad6f777ae82c49a72f086ad5c29d1501190741f77d97947519fc660830e1eb3b483e72
|
data/lib/mamiya/cli.rb
CHANGED
@@ -33,8 +33,13 @@ module Mamiya
|
|
33
33
|
rescue Exception => e
|
34
34
|
logger.fatal "#{e.class}: #{e.message}"
|
35
35
|
|
36
|
+
use_fatal = config(:no_error) && config[:show_backtrace_in_fatal]
|
36
37
|
e.backtrace.map{ |_| _.prepend("\t") }.each do |line|
|
37
|
-
|
38
|
+
if use_fatal
|
39
|
+
logger.fatal line
|
40
|
+
else
|
41
|
+
logger.debug line
|
42
|
+
end
|
38
43
|
end
|
39
44
|
end
|
40
45
|
end
|
@@ -210,18 +215,9 @@ module Mamiya
|
|
210
215
|
at_exit { File.unlink(pidfile) if File.exist?(pidfile) }
|
211
216
|
end
|
212
217
|
|
213
|
-
reload_queue = Queue.new
|
214
|
-
reload_thread = Thread.new do
|
215
|
-
while reload_queue.pop
|
216
|
-
logger.info "Reopening"
|
217
|
-
logger.reopen
|
218
|
-
logger.info "Log reopened"
|
219
|
-
end
|
220
|
-
end
|
221
|
-
reload_thread.abort_on_exception = true
|
222
|
-
|
223
218
|
trap(:HUP) do
|
224
|
-
|
219
|
+
$stderr.puts "hi"
|
220
|
+
logger.reopen
|
225
221
|
end
|
226
222
|
end
|
227
223
|
|
data/lib/mamiya/logger.rb
CHANGED
data/lib/mamiya/version.rb
CHANGED
data/spec/logger_spec.rb
CHANGED
@@ -56,7 +56,7 @@ describe Mamiya::Logger do
|
|
56
56
|
|
57
57
|
describe "#reopen" do
|
58
58
|
it "reopens file IOs" do
|
59
|
-
io = double('io', path: 'foo', tty?: false, write: 0, sync: true)
|
59
|
+
io = double('io', path: 'foo', tty?: false, write: 0, sync: true, puts: nil)
|
60
60
|
expect(io).to receive(:reopen).with('foo', 'a')
|
61
61
|
expect(io).to receive(:sync=).with(true)
|
62
62
|
|