log4r-exceptionable 0.7.0 → 0.8.0
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.
- data/.travis.yml +0 -3
- data/lib/log4r-exceptionable.rb +6 -0
- data/lib/log4r-exceptionable/configuration.rb +10 -3
- data/lib/log4r-exceptionable/helper.rb +2 -1
- data/lib/log4r-exceptionable/sidekiq_failure_handler.rb +51 -0
- data/lib/log4r-exceptionable/version.rb +1 -1
- data/{graylog2-resque.gemspec → log4r-exceptionable.gemspec} +1 -0
- data/spec/configuration_spec.rb +2 -1
- data/spec/helper_spec.rb +36 -0
- data/spec/resque_failure_handler_spec.rb +9 -9
- data/spec/sidekiq_failure_handler_spec.rb +178 -0
- data/spec/spec_helper.rb +46 -5
- metadata +31 -5
data/.travis.yml
CHANGED
data/lib/log4r-exceptionable.rb
CHANGED
@@ -9,6 +9,12 @@ begin
|
|
9
9
|
rescue LoadError
|
10
10
|
end
|
11
11
|
|
12
|
+
# optional if only using sidekiq
|
13
|
+
begin
|
14
|
+
require "log4r-exceptionable/sidekiq_failure_handler"
|
15
|
+
rescue LoadError
|
16
|
+
end
|
17
|
+
|
12
18
|
# optional if only using rack
|
13
19
|
begin
|
14
20
|
require "log4r-exceptionable/resque_failure_handler"
|
@@ -6,7 +6,7 @@ module Log4rExceptionable
|
|
6
6
|
|
7
7
|
class << self
|
8
8
|
# required - default loggers used if source logger not available
|
9
|
-
attr_accessor :rack_failure_logger, :resque_failure_logger
|
9
|
+
attr_accessor :rack_failure_logger, :resque_failure_logger, :sidekiq_failure_logger
|
10
10
|
# Allows one to force use of default loggers by setting to false
|
11
11
|
attr_accessor :use_source_logger
|
12
12
|
# The level to log exceptions
|
@@ -15,17 +15,20 @@ module Log4rExceptionable
|
|
15
15
|
attr_accessor :context_inclusions
|
16
16
|
# blacklist of context keys (e.g. keys in rack env) to exclude in log4r context when logging
|
17
17
|
attr_accessor :context_exclusions
|
18
|
+
# Swallow exceptions raised by the call to the logger, printing to stderr, defaults to true
|
19
|
+
attr_accessor :failsafe_logging
|
18
20
|
end
|
19
21
|
|
20
22
|
# default values
|
21
23
|
self.use_source_logger = true
|
22
24
|
self.log_level = :fatal
|
25
|
+
self.failsafe_logging = true
|
23
26
|
|
24
27
|
def self.configure
|
25
28
|
yield self
|
26
29
|
|
27
|
-
if ! self.rack_failure_logger && ! self.resque_failure_logger
|
28
|
-
raise "log4r-exceptionable requires a rack_failure_logger or resque_failure_logger"
|
30
|
+
if ! self.rack_failure_logger && ! self.resque_failure_logger && ! self.sidekiq_failure_logger
|
31
|
+
raise "log4r-exceptionable requires a rack_failure_logger or resque_failure_logger or sidekiq_failure_logger"
|
29
32
|
end
|
30
33
|
|
31
34
|
if self.rack_failure_logger
|
@@ -36,6 +39,10 @@ module Log4rExceptionable
|
|
36
39
|
self.set_logger(:resque_failure_logger)
|
37
40
|
end
|
38
41
|
|
42
|
+
if self.sidekiq_failure_logger
|
43
|
+
self.set_logger(:sidekiq_failure_logger)
|
44
|
+
end
|
45
|
+
|
39
46
|
self.context_inclusions = Set.new(self.context_inclusions) if self.context_inclusions
|
40
47
|
self.context_exclusions = Set.new(self.context_exclusions) if self.context_exclusions
|
41
48
|
|
@@ -20,7 +20,8 @@ module Log4rExceptionable
|
|
20
20
|
end
|
21
21
|
|
22
22
|
rescue => e
|
23
|
-
|
23
|
+
raise e unless Log4rExceptionable::Configuration.failsafe_logging
|
24
|
+
$stderr.puts "Log4r Exceptionable could not log exception: #{e.class} #{e.message}"
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'sidekiq'
|
2
|
+
|
3
|
+
module Log4rExceptionable
|
4
|
+
|
5
|
+
# A Resque Failure backend that logs exceptions with log4r
|
6
|
+
#
|
7
|
+
class SidekiqFailureHandler
|
8
|
+
include Log4rExceptionable::Helper
|
9
|
+
|
10
|
+
def call(worker, msg, queue)
|
11
|
+
begin
|
12
|
+
yield
|
13
|
+
rescue => ex
|
14
|
+
log_exception(worker, queue, ex, msg)
|
15
|
+
raise
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def log_exception(worker, queue, ex, msg)
|
20
|
+
|
21
|
+
log_with_context do |context|
|
22
|
+
|
23
|
+
add_context(context, "sidekiq_worker", worker.class)
|
24
|
+
add_context(context, "sidekiq_queue", queue.to_s)
|
25
|
+
add_context(context, "sidekiq_args", msg['args'])
|
26
|
+
add_context(context, "sidekiq_jid", worker.jid)
|
27
|
+
|
28
|
+
# add in any extra payload data
|
29
|
+
msg.each do |k, v|
|
30
|
+
next if %w[class args].include?(k)
|
31
|
+
add_context(context, "sidekiq_msg_#{k}", v)
|
32
|
+
end
|
33
|
+
|
34
|
+
error_logger = nil
|
35
|
+
if Log4rExceptionable::Configuration.use_source_logger
|
36
|
+
payload_class = worker.logger rescue nil
|
37
|
+
if worker.logger.instance_of?(Log4r::Logger)
|
38
|
+
error_logger = worker.logger
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
error_logger ||= Log4rExceptionable::Configuration.sidekiq_failure_logger
|
43
|
+
|
44
|
+
error_logger.send(Log4rExceptionable::Configuration.log_level, ex)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/spec/configuration_spec.rb
CHANGED
@@ -7,13 +7,14 @@ describe Log4rExceptionable::Configuration do
|
|
7
7
|
before(:each) do
|
8
8
|
Log4rExceptionable::Configuration.rack_failure_logger = nil
|
9
9
|
Log4rExceptionable::Configuration.resque_failure_logger = nil
|
10
|
+
Log4rExceptionable::Configuration.sidekiq_failure_logger = nil
|
10
11
|
end
|
11
12
|
|
12
13
|
it "should raise if no logger in config" do
|
13
14
|
lambda {
|
14
15
|
Log4rExceptionable::Configuration.configure do |config|
|
15
16
|
end
|
16
|
-
}.should raise_error("log4r-exceptionable requires a rack_failure_logger or resque_failure_logger")
|
17
|
+
}.should raise_error("log4r-exceptionable requires a rack_failure_logger or resque_failure_logger or sidekiq_failure_logger")
|
17
18
|
end
|
18
19
|
|
19
20
|
it "should not raise if config has a rack logger" do
|
data/spec/helper_spec.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Log4rExceptionable::Helper do
|
4
|
+
include Log4rExceptionable::Helper
|
5
|
+
|
6
|
+
context "helper" do
|
7
|
+
|
8
|
+
before(:each) do
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should raise if failsafe_logging false" do
|
12
|
+
Log4rExceptionable::Configuration.failsafe_logging = false
|
13
|
+
$stderr.should_not_receive(:puts)
|
14
|
+
|
15
|
+
lambda {
|
16
|
+
log_with_context do
|
17
|
+
raise "I failed"
|
18
|
+
end
|
19
|
+
}.should raise_error("I failed")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should not raise if failsafe_logging true" do
|
23
|
+
Log4rExceptionable::Configuration.failsafe_logging = true
|
24
|
+
$stderr.should_receive(:puts)
|
25
|
+
|
26
|
+
|
27
|
+
lambda {
|
28
|
+
log_with_context do
|
29
|
+
raise "I failed"
|
30
|
+
end
|
31
|
+
}.should_not raise_error("I failed")
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Log4rExceptionable::ResqueFailureHandler do
|
4
|
-
include
|
4
|
+
include PerformResqueJob
|
5
5
|
|
6
6
|
context "handling resque failures" do
|
7
7
|
|
@@ -65,7 +65,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
65
65
|
Log4r::MDC.get('resque_args').should == ["foo"]
|
66
66
|
end
|
67
67
|
|
68
|
-
|
68
|
+
run_job(SomeJob, 'foo', :queue => :somequeue, :inline => true)
|
69
69
|
end
|
70
70
|
|
71
71
|
it "uses default logger if job logger is nil" do
|
@@ -76,7 +76,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
76
76
|
Log4r::MDC.get('resque_class').should == SomeJobWithNilLogger
|
77
77
|
end
|
78
78
|
|
79
|
-
|
79
|
+
run_job(SomeJobWithNilLogger, 'foo', :queue => :somequeue, :inline => true)
|
80
80
|
end
|
81
81
|
|
82
82
|
it "uses default logger if job logger is not log4r" do
|
@@ -87,7 +87,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
87
87
|
Log4r::MDC.get('resque_class').should == SomeJobWithOtherLogger
|
88
88
|
end
|
89
89
|
|
90
|
-
|
90
|
+
run_job(SomeJobWithOtherLogger, 'foo', :queue => :somequeue, :inline => true)
|
91
91
|
end
|
92
92
|
|
93
93
|
it "uses job logger if set" do
|
@@ -99,7 +99,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
99
99
|
Log4r::MDC.get('resque_class').should == SomeJobWithLogger
|
100
100
|
end
|
101
101
|
|
102
|
-
|
102
|
+
run_job(SomeJobWithLogger, 'foo', :queue => :somequeue, :inline => true)
|
103
103
|
end
|
104
104
|
|
105
105
|
it "uses default logger if source logger disabled" do
|
@@ -113,7 +113,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
113
113
|
Log4r::MDC.get('resque_class').should == SomeJobWithLogger
|
114
114
|
end
|
115
115
|
|
116
|
-
|
116
|
+
run_job(SomeJobWithLogger, 'foo', :queue => :somequeue, :inline => true)
|
117
117
|
end
|
118
118
|
|
119
119
|
it "only includes inclusions if set" do
|
@@ -125,7 +125,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
125
125
|
Log4r::MDC.get_context.keys.should == ['resque_queue']
|
126
126
|
end
|
127
127
|
|
128
|
-
|
128
|
+
run_job(SomeJob, 'foo', :queue => :somequeue, :inline => true)
|
129
129
|
end
|
130
130
|
|
131
131
|
it "excludes exclusions if set" do
|
@@ -137,7 +137,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
137
137
|
Log4r::MDC.get_context.keys.should_not include 'resque_queue'
|
138
138
|
end
|
139
139
|
|
140
|
-
|
140
|
+
run_job(SomeJob, 'foo', :queue => :somequeue, :inline => true)
|
141
141
|
end
|
142
142
|
|
143
143
|
it "logs with given log_level" do
|
@@ -148,7 +148,7 @@ describe Log4rExceptionable::ResqueFailureHandler do
|
|
148
148
|
msg.message.should == "I failed"
|
149
149
|
end
|
150
150
|
|
151
|
-
|
151
|
+
run_job(SomeJob, 'foo', :queue => :somequeue, :inline => true)
|
152
152
|
end
|
153
153
|
|
154
154
|
|
@@ -0,0 +1,178 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Log4rExceptionable::SidekiqFailureHandler do
|
4
|
+
include PerformSidekiqJob
|
5
|
+
|
6
|
+
context "handling sidekiq failures" do
|
7
|
+
|
8
|
+
class SomeJob
|
9
|
+
include Sidekiq::Worker
|
10
|
+
def perform(*args)
|
11
|
+
raise "I failed"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class SomeJobWithNilLogger
|
16
|
+
include Sidekiq::Worker
|
17
|
+
def logger
|
18
|
+
nil
|
19
|
+
end
|
20
|
+
|
21
|
+
def perform(*args)
|
22
|
+
raise "I failed"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class SomeJobWithOtherLogger
|
27
|
+
include Sidekiq::Worker
|
28
|
+
def logger
|
29
|
+
self
|
30
|
+
end
|
31
|
+
|
32
|
+
def perform(*args)
|
33
|
+
raise "I failed"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class SomeJobWithLogger
|
38
|
+
include Sidekiq::Worker
|
39
|
+
def logger
|
40
|
+
Log4r::Logger["SomeJobWithLogger"] || Log4r::Logger.new("SomeJobWithLogger")
|
41
|
+
end
|
42
|
+
|
43
|
+
def perform(*args)
|
44
|
+
raise "I failed"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
before(:each) do
|
49
|
+
Sidekiq.server_middleware do |chain|
|
50
|
+
chain.insert_before Sidekiq::Middleware::Server::Logging, Log4rExceptionable::SidekiqFailureHandler
|
51
|
+
end
|
52
|
+
|
53
|
+
Log4rExceptionable::Configuration.configure do |config|
|
54
|
+
config.sidekiq_failure_logger = 'sidekiqlogger'
|
55
|
+
config.use_source_logger = true
|
56
|
+
config.context_inclusions = nil
|
57
|
+
config.context_exclusions = nil
|
58
|
+
config.log_level = :fatal
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
it "triggers failure handler" do
|
63
|
+
|
64
|
+
Log4r::Logger['sidekiqlogger'].should_receive(:fatal) do |msg|
|
65
|
+
msg.should be_instance_of RuntimeError
|
66
|
+
msg.message.should == "I failed"
|
67
|
+
msg.backtrace.first.should =~ /sidekiq_failure_handler_spec.rb/
|
68
|
+
Log4r::MDC.get('sidekiq_worker').should == SomeJob
|
69
|
+
Log4r::MDC.get('sidekiq_queue').should == "somequeue"
|
70
|
+
Log4r::MDC.get('sidekiq_args').should == ["foo"]
|
71
|
+
end
|
72
|
+
|
73
|
+
lambda {
|
74
|
+
run_job(SomeJob, 'foo', :queue => :somequeue)
|
75
|
+
}.should raise_error("I failed")
|
76
|
+
end
|
77
|
+
|
78
|
+
it "uses default logger if job logger is nil" do
|
79
|
+
|
80
|
+
Log4r::Logger['sidekiqlogger'].should_receive(:fatal) do |msg|
|
81
|
+
msg.should be_instance_of RuntimeError
|
82
|
+
msg.message.should == "I failed"
|
83
|
+
Log4r::MDC.get('sidekiq_worker').should == SomeJobWithNilLogger
|
84
|
+
end
|
85
|
+
|
86
|
+
lambda {
|
87
|
+
run_job(SomeJobWithNilLogger, 'foo', :queue => :somequeue)
|
88
|
+
}.should raise_error("I failed")
|
89
|
+
end
|
90
|
+
|
91
|
+
it "uses default logger if job logger is not log4r" do
|
92
|
+
|
93
|
+
Log4r::Logger['sidekiqlogger'].should_receive(:fatal) do |msg|
|
94
|
+
msg.should be_instance_of RuntimeError
|
95
|
+
msg.message.should == "I failed"
|
96
|
+
Log4r::MDC.get('sidekiq_worker').should == SomeJobWithOtherLogger
|
97
|
+
end
|
98
|
+
|
99
|
+
lambda {
|
100
|
+
run_job(SomeJobWithOtherLogger, 'foo', :queue => :somequeue)
|
101
|
+
}.should raise_error("I failed")
|
102
|
+
end
|
103
|
+
|
104
|
+
it "uses job logger if set" do
|
105
|
+
Log4r::Logger.new('SomeJobWithLogger')
|
106
|
+
Log4r::Logger['sidekiqlogger'].should_not_receive(:fatal)
|
107
|
+
Log4r::Logger['SomeJobWithLogger'].should_receive(:fatal) do |msg|
|
108
|
+
msg.should be_instance_of RuntimeError
|
109
|
+
msg.message.should == "I failed"
|
110
|
+
Log4r::MDC.get('sidekiq_worker').should == SomeJobWithLogger
|
111
|
+
end
|
112
|
+
|
113
|
+
lambda {
|
114
|
+
run_job(SomeJobWithLogger, 'foo', :queue => :somequeue)
|
115
|
+
}.should raise_error("I failed")
|
116
|
+
end
|
117
|
+
|
118
|
+
it "uses default logger if source logger disabled" do
|
119
|
+
Log4rExceptionable::Configuration.use_source_logger = false
|
120
|
+
|
121
|
+
Log4r::Logger.new('SomeJobWithLogger')
|
122
|
+
Log4r::Logger['SomeJobWithLogger'].should_not_receive(:fatal)
|
123
|
+
Log4r::Logger['sidekiqlogger'].should_receive(:fatal) do |msg|
|
124
|
+
msg.should be_instance_of RuntimeError
|
125
|
+
msg.message.should == "I failed"
|
126
|
+
Log4r::MDC.get('sidekiq_worker').should == SomeJobWithLogger
|
127
|
+
end
|
128
|
+
|
129
|
+
lambda {
|
130
|
+
run_job(SomeJobWithLogger, 'foo', :queue => :somequeue)
|
131
|
+
}.should raise_error("I failed")
|
132
|
+
end
|
133
|
+
|
134
|
+
it "only includes inclusions if set" do
|
135
|
+
Log4rExceptionable::Configuration.context_inclusions = ['sidekiq_queue']
|
136
|
+
|
137
|
+
Log4r::Logger['sidekiqlogger'].should_receive(:fatal) do |msg|
|
138
|
+
msg.should be_instance_of RuntimeError
|
139
|
+
msg.message.should == "I failed"
|
140
|
+
Log4r::MDC.get_context.keys.should == ['sidekiq_queue']
|
141
|
+
end
|
142
|
+
|
143
|
+
lambda {
|
144
|
+
run_job(SomeJob, 'foo', :queue => :somequeue)
|
145
|
+
}.should raise_error("I failed")
|
146
|
+
end
|
147
|
+
|
148
|
+
it "excludes exclusions if set" do
|
149
|
+
Log4rExceptionable::Configuration.context_exclusions = ['sidekiq_queue']
|
150
|
+
|
151
|
+
Log4r::Logger['sidekiqlogger'].should_receive(:fatal) do |msg|
|
152
|
+
msg.should be_instance_of RuntimeError
|
153
|
+
msg.message.should == "I failed"
|
154
|
+
Log4r::MDC.get_context.keys.should_not include 'sidekiq_queue'
|
155
|
+
end
|
156
|
+
|
157
|
+
lambda {
|
158
|
+
run_job(SomeJob, 'foo', :queue => :somequeue)
|
159
|
+
}.should raise_error("I failed")
|
160
|
+
end
|
161
|
+
|
162
|
+
it "logs with given log_level" do
|
163
|
+
Log4rExceptionable::Configuration.log_level = :info
|
164
|
+
|
165
|
+
Log4r::Logger['sidekiqlogger'].should_receive(:info) do |msg|
|
166
|
+
msg.should be_instance_of RuntimeError
|
167
|
+
msg.message.should == "I failed"
|
168
|
+
end
|
169
|
+
|
170
|
+
lambda {
|
171
|
+
run_job(SomeJob, 'foo', :queue => :somequeue)
|
172
|
+
}.should raise_error("I failed")
|
173
|
+
end
|
174
|
+
|
175
|
+
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require "rack/test"
|
2
2
|
require 'rspec'
|
3
3
|
require 'resque'
|
4
|
+
require 'sidekiq'
|
5
|
+
require 'sidekiq/processor'
|
6
|
+
require 'sidekiq/fetch'
|
4
7
|
require 'log4r-exceptionable'
|
5
8
|
require 'ap'
|
6
9
|
|
@@ -26,24 +29,28 @@ unless ENV['CI']
|
|
26
29
|
File.delete("#{spec_dir}/dump.rdb") rescue nil
|
27
30
|
end
|
28
31
|
end
|
29
|
-
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
RSpec.configure do |config|
|
36
|
+
config.before(:each) { Log4rExceptionable::Configuration.failsafe_logging = false }
|
30
37
|
end
|
31
38
|
|
32
39
|
##
|
33
40
|
# Helper to perform job classes
|
34
41
|
#
|
35
|
-
module
|
42
|
+
module PerformResqueJob
|
36
43
|
|
37
|
-
def
|
44
|
+
def run_job(job_class, *job_args)
|
38
45
|
opts = job_args.last.is_a?(Hash) ? job_args.pop : {}
|
39
46
|
queue = opts[:queue] || Resque.queue_from_class(job_class)
|
40
47
|
|
41
48
|
Resque::Job.create(queue, job_class, *job_args)
|
42
49
|
|
43
|
-
|
50
|
+
run_queue(queue, opts)
|
44
51
|
end
|
45
52
|
|
46
|
-
def
|
53
|
+
def run_queue(queue, opts={})
|
47
54
|
worker = Resque::Worker.new(queue)
|
48
55
|
worker.very_verbose = true if opts[:verbose]
|
49
56
|
|
@@ -76,3 +83,37 @@ module PerformJob
|
|
76
83
|
end
|
77
84
|
|
78
85
|
end
|
86
|
+
|
87
|
+
Celluloid.logger = nil
|
88
|
+
|
89
|
+
module PerformSidekiqJob
|
90
|
+
|
91
|
+
def run_job(job_class, *job_args)
|
92
|
+
opts = job_args.last.is_a?(Hash) ? job_args.pop : {}
|
93
|
+
queue = (opts[:queue] || 'testqueue').to_s
|
94
|
+
|
95
|
+
Sidekiq.logger = mock().as_null_object
|
96
|
+
@boss = stub()
|
97
|
+
@processor = ::Sidekiq::Processor.new(@boss)
|
98
|
+
#Sidekiq.redis = REDIS
|
99
|
+
|
100
|
+
msg = Sidekiq.dump_json({ 'class' => job_class.to_s, 'args' => job_args })
|
101
|
+
@processor.process(::Sidekiq::BasicFetch::UnitOfWork.new(queue, msg))
|
102
|
+
@boss.verify
|
103
|
+
end
|
104
|
+
|
105
|
+
def dump_redis
|
106
|
+
result = {}
|
107
|
+
Sidekiq.redis.keys("*").each do |key|
|
108
|
+
type = Sidekiq.redis.type(key)
|
109
|
+
result[key] = case type
|
110
|
+
when 'string' then Sidekiq.redis.get(key)
|
111
|
+
when 'list' then Sidekiq.redis.lrange(key, 0, -1)
|
112
|
+
when 'set' then Sidekiq.redis.smembers(key)
|
113
|
+
else type
|
114
|
+
end
|
115
|
+
end
|
116
|
+
return result
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log4r-exceptionable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -91,6 +91,22 @@ dependencies:
|
|
91
91
|
- - ! '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: sidekiq
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
94
110
|
- !ruby/object:Gem::Dependency
|
95
111
|
name: log4r
|
96
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,17 +139,20 @@ files:
|
|
123
139
|
- LICENSE
|
124
140
|
- README.md
|
125
141
|
- Rakefile
|
126
|
-
- graylog2-resque.gemspec
|
127
142
|
- lib/log4r-exceptionable.rb
|
128
143
|
- lib/log4r-exceptionable/configuration.rb
|
129
144
|
- lib/log4r-exceptionable/helper.rb
|
130
145
|
- lib/log4r-exceptionable/rack_failure_handler.rb
|
131
146
|
- lib/log4r-exceptionable/resque_failure_handler.rb
|
147
|
+
- lib/log4r-exceptionable/sidekiq_failure_handler.rb
|
132
148
|
- lib/log4r-exceptionable/version.rb
|
149
|
+
- log4r-exceptionable.gemspec
|
133
150
|
- spec/configuration_spec.rb
|
151
|
+
- spec/helper_spec.rb
|
134
152
|
- spec/rack_failure_handler_spec.rb
|
135
153
|
- spec/redis-test.conf
|
136
154
|
- spec/resque_failure_handler_spec.rb
|
155
|
+
- spec/sidekiq_failure_handler_spec.rb
|
137
156
|
- spec/spec_helper.rb
|
138
157
|
homepage: ''
|
139
158
|
licenses: []
|
@@ -147,22 +166,29 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
166
|
- - ! '>='
|
148
167
|
- !ruby/object:Gem::Version
|
149
168
|
version: '0'
|
169
|
+
segments:
|
170
|
+
- 0
|
171
|
+
hash: 391045047313925202
|
150
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
173
|
none: false
|
152
174
|
requirements:
|
153
175
|
- - ! '>='
|
154
176
|
- !ruby/object:Gem::Version
|
155
177
|
version: '0'
|
178
|
+
segments:
|
179
|
+
- 0
|
180
|
+
hash: 391045047313925202
|
156
181
|
requirements: []
|
157
182
|
rubyforge_project: log4r-exceptionable
|
158
|
-
rubygems_version: 1.8.
|
183
|
+
rubygems_version: 1.8.24
|
159
184
|
signing_key:
|
160
185
|
specification_version: 3
|
161
186
|
summary: Failure handlers for rack and resque that log failures using log4r
|
162
187
|
test_files:
|
163
188
|
- spec/configuration_spec.rb
|
189
|
+
- spec/helper_spec.rb
|
164
190
|
- spec/rack_failure_handler_spec.rb
|
165
191
|
- spec/redis-test.conf
|
166
192
|
- spec/resque_failure_handler_spec.rb
|
193
|
+
- spec/sidekiq_failure_handler_spec.rb
|
167
194
|
- spec/spec_helper.rb
|
168
|
-
has_rdoc:
|