vendor/gems/logging-0.9.7/lib/logging/layout.rb
def format_obj( obj )
    case obj
    when String; obj
    when Exception 
      str = "<#{obj.class.name}> #{obj.message}"
      if @backtrace && !obj.backtrace.nil?
        str << "\n\t" << obj.backtrace.join("\n\t")
      end
      str
    when nil; "<#{obj.class.name}> nil"
    else
      str = "<#{obj.class.name}> "
      str << case @obj_format
             when :inspect; obj.inspect
             when :yaml; try_yaml(obj)
             else obj.to_s end
      str
    end
  end
# call-seq:
#    format_obj( obj )
#
# Return a string representation of the given object. Depending upon
# the configuration of the logger system the format will be an +inspect+
# based represenation or a +yaml+ based representation.
#
call-seq:
format_obj( obj )

Return a string representation of the given object. Depending upon
the configuration of the logger system the format will be an +inspect+
based represenation or a +yaml+ based representation.
call - seq : format_obj ( obj ) Return a string representation of the given object . Depending upon the configuration of the logger system the format will be an + inspect + based represenation or a + yaml + based representation .
def format_obj( obj )
    case obj
    when String; obj
    when Exception 
      str = "<#{obj.class.name}> #{obj.message}"
      if @backtrace && !obj.backtrace.nil?
        str << "\n\t" << obj.backtrace.join("\n\t")
      end
      str
    when nil; "<#{obj.class.name}> nil"
    else
      str = "<#{obj.class.name}> "
      str << case @obj_format
             when :inspect; obj.inspect
             when :yaml; try_yaml(obj)
             else obj.to_s end
      str
    end
  end
def format_obj ( obj ) case obj when String ; obj when Exception str = "<#{obj.class.name}> #{obj.message}" if @backtrace && ! obj . backtrace . nil? str << "\n\t" << obj . backtrace . join ( "\n\t" ) end str when nil ; "<#{obj.class.name}> nil" else str = "<#{obj.class.name}> " str << case @obj_format when :inspect ; obj . inspect when :yaml ; try_yaml ( obj ) else obj . to_s end str end end
call-seq:
format_obj( obj )
call - seq : format_obj ( obj )
obj