11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/tracee/ext/better_errors.rb', line 11
def log_exception_with_decorate
return unless logger = ::BetterErrors.logger
message = "\n#{@error_page.exception.class} - #{@error_page.exception.message}:"
logger.fatal message
frames = @error_page.backtrace_frames frames = frames.map(&:to_s).reject {|line| line =~ IGNORE_RE}
frames = Stack::BaseDecorator.(frames, paint_code_line: :greenish)
frames.each do |frame|
if frame =~ /^[-\w]+ \(\d+\.[\w\.]+\) /
logger.debug " #{frame}"
else
logger.fatal " #{frame}"
end
end
end
|