lib/logging/layout.rb in logging-0.9.8 vs lib/logging/layout.rb in logging-1.0.0

- old
+ new

@@ -1,8 +1,6 @@ -require 'yaml' - 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. @@ -28,10 +26,12 @@ # If the format is not specified then the global object format is used # (see Logging#format_as). If the global object format is not specified # then <tt>:string</tt> is used. # def initialize( opts = {} ) + ::Logging.init unless ::Logging.const_defined? :MAX_LEVEL_LENGTH + default = ::Logging.const_defined?('OBJ_FORMAT') ? ::Logging::OBJ_FORMAT : nil f = opts.getopt(:format_as, default) f = f.intern if f.instance_of? String @@ -111,9 +111,7 @@ obj.inspect end end # class Layout end # module Logging - -Logging.require_all_libs_relative_to(__FILE__, 'layouts') # EOF