Sha256: f057b56f574315166191a8f0bb24ba8c08cfcf0ef693479be27655694bbcdf47

Contents?: true

Size: 1.02 KB

Versions: 15

Compression:

Stored size: 1.02 KB

Contents

module Logging
module Layouts

  # The +Basic+ layout class provides methods for simple formatting of log
  # events. The resulting string follows the format below.
  #
  #     LEVEL  LoggerName : log message
  #
  # _LEVEL_ is the log level of the event. _LoggerName_ is the name of the
  # logger that generated the event. <em>log message</em> is the message
  # or object that was passed to the logger. If multiple message or objects
  # were passed to the logger then each will be printed on its own line with
  # the format show above.
  #
  class Basic < ::Logging::Layout

    # call-seq:
    #    format( event )
    #
    # Returns a string representation of the given loggging _event_. See the
    # class documentation for details about the formatting used.
    #
    def format( event )
      obj = format_obj(event.data)
      sprintf("%*s  %s : %s\n", ::Logging::MAX_LEVEL_LENGTH,
              ::Logging::LNAMES[event.level], event.logger, obj)
    end

  end  # class Basic
end  # module Layouts
end  # module Logging

# EOF

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
TwP-logging-0.9.7 lib/logging/layouts/basic.rb
TwP-logging-0.9.8 lib/logging/layouts/basic.rb
ottobar-logging-0.9.5.1 lib/logging/layouts/basic.rb
logging-0.9.1 lib/logging/layouts/basic.rb
logging-0.9.3 lib/logging/layouts/basic.rb
logging-0.9.0 lib/logging/layouts/basic.rb
logging-0.9.2 lib/logging/layouts/basic.rb
logging-0.9.4 lib/logging/layouts/basic.rb
logging-0.9.5 lib/logging/layouts/basic.rb
logging-0.9.6 lib/logging/layouts/basic.rb
logging-0.9.7 lib/logging/layouts/basic.rb
logging-0.9.8 lib/logging/layouts/basic.rb
mack-0.8.2 lib/gems/logging-0.9.4/lib/logging/layouts/basic.rb
mack-0.8.3.1 lib/gems/logging-0.9.4/lib/logging/layouts/basic.rb
mack-0.8.3 lib/gems/logging-0.9.4/lib/logging/layouts/basic.rb