format(arg)
private
Formats arg for the logger
-
If arg is an Exception, it will format the error message and the back trace.
-
If arg responds to #to_str, it will return it.
-
Otherwise it will return arg.inspect.
Show source
def format(arg)
if arg.is_a?(Exception)
"#{arg.class}: #{AccessLog.escape(arg.message)}\n\t" <<
arg.backtrace.join("\n\t") << "\n"
elsif arg.respond_to?(:to_str)
AccessLog.escape(arg.to_str)
else
arg.inspect
end
end