Method: Logsly::Logging182::Layouts::Parseable#format_obj
- Defined in:
- lib/logsly/logging182/layouts/parseable.rb
#format_obj(obj) ⇒ Object
Public: Take a given object and convert it into a format suitable for inclusion as a log message. The conversion allows the object to be more easily expressed in YAML or JSON form.
If the object is an Exception, then this method will return a Hash containing the exception class name, message, and backtrace (if any).
obj - The Object to format
Returns the formatted Object.
215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/logsly/logging182/layouts/parseable.rb', line 215 def format_obj( obj ) case obj when Exception h = { :class => obj.class.name, :message => obj. } h[:backtrace] = obj.backtrace if @backtrace && !obj.backtrace.nil? h when Time iso8601_format(obj) else obj end end |