18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/stackify/logger_client.rb', line 18
def log_exception level= :error, ex
if ex.is_a?(Stackify::StackifiedError)
Stackify::Utils.do_only_if_authorized_and_mode_is_on Stackify::MODES[:logging] do
if acceptable?(level, ex.message) && Stackify.working?
if @@errors_governor.can_send? ex
worker = Stackify::AddMsgWorker.new
task = log_exception_task level, ex
worker.async_perform ScheduleDelay.new, task
else
Stackify.internal_log :warn,
"LoggerClient: logging of exception with message \"#{ex.message}\" is skipped - flood_limit is exceeded"
end
end
end
else
Stackify.log_internal_error 'LoggerClient: log_exception should get StackifiedError object'
end
end
|