Sha256: 3c6f8b9f345b0c7f2f2fb847b5570a6f2b5f91d133aa2adae050afac777c08a1

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

require "logger"

module Sad
	class Logger
=begin
    # Low-level information, mostly for developers
    DEBUG = 0
    # generic, useful information about system operation
    INFO = 1
    # a warning
    WARN = 2
    # a handleable error condition
    ERROR = 3
    # an unhandleable error that results in a program crash
    FATAL = 4
    # an unknown message that should always be logged
    UNKNOWN = 5
=end
		def initialize(opts={})
			opts = {
				:path => STDOUT,
				:level => 2
			}.update opts.dup

			@logger = ::Logger.new(opts[:path])
			@logger.level = opts[:level]
		end

		def method_missing(method_name, *args, &block)
			@logger.send(method_name, *args, &block)
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sad-1.5.1 lib/sad/logger.rb
sad-1.5.0 lib/sad/logger.rb