Sha256: cbc1ed980a2be5692f161f96def2654089743a9d4dd2db881288717180f86cea

Contents?: true

Size: 1023 Bytes

Versions: 31

Compression:

Stored size: 1023 Bytes

Contents

module Logging::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 Logging::Layouts

# EOF

Version data entries

31 entries across 31 versions & 5 rubygems

Version Path
TwP-logging-0.9.8.1 lib/logging/layouts/basic.rb
TwP-logging-0.9.8.2 lib/logging/layouts/basic.rb
TwP-logging-1.0.0 lib/logging/layouts/basic.rb
TwP-logging-1.1.0 lib/logging/layouts/basic.rb
TwP-logging-1.1.1 lib/logging/layouts/basic.rb
TwP-logging-1.1.2 lib/logging/layouts/basic.rb
TwP-logging-1.1.3 lib/logging/layouts/basic.rb
TwP-logging-1.1.4 lib/logging/layouts/basic.rb
TwP-logging-1.2.0 lib/logging/layouts/basic.rb
TwP-logging-1.2.2 lib/logging/layouts/basic.rb
pjstadig-logging-1.1.4.1 lib/logging/layouts/basic.rb
logging-1.4.3 lib/logging/layouts/basic.rb
sgeorgi-logging-1.4.2 lib/logging/layouts/basic.rb
logging-1.4.2 lib/logging/layouts/basic.rb
logging-1.4.1 lib/logging/layouts/basic.rb
logging-1.4.0 lib/logging/layouts/basic.rb
redcar-0.3.1dev lib/logging/lib/logging/layouts/basic.rb
redcar-0.3.0dev lib/logging/lib/logging/layouts/basic.rb
logging-1.3.0 lib/logging/layouts/basic.rb
redcar-0.2.9dev lib/logging/lib/logging/layouts/basic.rb