Sha256: 8211e54321514e4d66d3b5bcebd61ff6b4c9811569bc03fc239e23cf5661cc2b

Contents?: true

Size: 659 Bytes

Versions: 5

Compression:

Stored size: 659 Bytes

Contents

module MJ; module Logging;

    #
    # Basic Layout for the logging framework.
    #
    # Will prefix message according to the following list:
    #
    #   WARNING => 'warning: '
    #   ERROR   => 'error: '
    #   REST    => ''
    class BasicLayout < ::Logging::Layout

        def format( event )
          obj = format_obj(event.data)

          return case event.level

          when ::Logging::level_num(:ERROR)
              sprintf("error: %s\n", obj)

          when ::Logging::level_num(:WARN)
              sprintf("warning: %s\n", obj)

          else
              obj + "\n"
          end
        end

    end # class BasicLayout

end; end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
build-tool-0.1.4 lib/mj/logging.rb
build-tool-0.1.3 lib/mj/logging.rb
build-tool-0.1.2 lib/mj/logging.rb
build-tool-0.1.0 lib/mj/logging.rb
build-tool-0.1.1 lib/mj/logging.rb