15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/logbert/formatters.rb', line 15
def format(msg)
level = msg.level.to_s.upcase.ljust(8)
output = "#{level} [time='#{msg.time}' pid='#{msg.pid}' logger='#{msg.logger}'] : #{msg.content}"
if msg.exception
output = [output, "\n\nException information:\n", msg.exception[:exc_class], ": ", msg.exception[:exc_message], "\n"]
backtrace = backtrace = msg.exception[:exc_backtrace]
if backtrace
output += [backtrace.join($/), "\n\n"]
else
output << "(Backtrace is unavailable)\n\n"
end
output = output.join
end
return output
end
|