Sha256: 5068b0778ca2ed86f0c904576d2512459e0f4c25322a1730d442359f94eecdd4

Contents?: true

Size: 560 Bytes

Versions: 2

Compression:

Stored size: 560 Bytes

Contents

require 'forwardable'
require 'mixlib/log'

module LoggingLibrary
  #
  # Responsible for printing out log messages. Not intended to be used directly from user code; use the Loggable mixin
  # (preferred) or LoggerFactory (secondary choice) to create a logger.
  #
  class Logger
    include Mixlib::Log
    extend Forwardable

    def_delegator :logger, :progname, :name

    def initialize(name)
      init(LoggingLibrary::output_device)

      logger.level = :info
      logger.progname = name
      logger.formatter = CustomFormatter.new
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logging_library-1.3.0 lib/logging_library/logger.rb
logging_library-1.2.0 lib/logging_library/logger.rb