Class: EZDyn::EZDynLog

Inherits:
Object
  • Object
show all
Defined in:
lib/ezdyn/log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEZDynLog

Returns a new instance of EZDynLog.



14
15
16
17
18
19
20
21
22
23
# File 'lib/ezdyn/log.rb', line 14

def initialize
  @logger = Logger.new(STDERR)
  @logger.level = Logger::DEBUG
  @logger.datetime_format = '%Y-%m-%d %H:%M:%S'
  @logger.formatter =
    proc do |sev, dt, prog, msg|
      "#{dt} #{sev}: #{msg}\n"
    end
  @logger.debug { "Logger initialized" }
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



12
13
14
# File 'lib/ezdyn/log.rb', line 12

def logger
  @logger
end