4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/log4jruby/log4j_args.rb', line 4
def convert(object = nil, exception = nil)
msg = ''
if exception
msg << object.to_s
else
exception = block_given? ? yield : object
end
if exception.is_a?(NativeException)
append_ruby_error(msg, exception)
msg << "\nNativeException:"
exception = exception.cause
elsif exception.is_a?(::Exception)
append_ruby_error(msg, exception)
exception = nil
elsif !exception.is_a?(java.lang.Throwable)
msg << exception.to_s
exception = nil
end
[msg, exception]
end
|