lib/logging/layout.rb in logging-1.6.1 vs lib/logging/layout.rb in logging-1.6.2
- old
+ new
@@ -1,6 +1,6 @@
-
+
module Logging
# The +Layout+ class provides methods for formatting log events into a
# string representation. Layouts are used by Appenders to format log
# events before writing them to the logging destination.
@@ -12,11 +12,11 @@
class Layout
# call-seq:
# Layout.new( :format_as => :string )
#
- # Creates a new layout that will format objecs as strings using the
+ # Creates a new layout that will format objects as strings using the
# given <tt>:format_as</tt> style. This can be one of <tt>:string</tt>,
# <tt>:inspect</tt>, or <tt>:yaml</tt>. These formatting commands map to
# the following object methods:
#
# * :string => to_s
@@ -50,11 +50,11 @@
end
# call-seq:
# format( event )
#
- # Returns a string representation of the given loggging _event_. It is
+ # Returns a string representation of the given logging _event_. It is
# up to subclasses to implement this method.
#
def format( event ) nil end
# call-seq:
@@ -68,23 +68,23 @@
# call-seq:
# footer
#
# Returns a footer string to be used at the end of a logging appender.
#
- def footer( ) '' end
+ def footer( ) '' 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.
+ # based representation or a +yaml+ based representation.
#
def format_obj( obj )
case obj
when String; obj
- when Exception
+ when Exception
str = "<#{obj.class.name}> #{obj.message}"
if @backtrace && !obj.backtrace.nil?
str << "\n\t" << obj.backtrace.join("\n\t")
end
str
@@ -112,6 +112,5 @@
end
end # class Layout
end # module Logging
-# EOF