Class: EasyMapper::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_mapper/logger.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.device=(value) ⇒ Object

Sets the attribute device

Parameters:

  • value

    the value to set the attribute device to.



6
7
8
# File 'lib/easy_mapper/logger.rb', line 6

def device=(value)
  @device = value
end

.level=(value) ⇒ Object

Sets the attribute level

Parameters:

  • value

    the value to set the attribute level to.



6
7
8
# File 'lib/easy_mapper/logger.rb', line 6

def level=(value)
  @level = value
end

Class Method Details

.loggerObject



11
12
13
14
15
16
17
18
19
# File 'lib/easy_mapper/logger.rb', line 11

def logger
  unless @logger
    @logger = ::Logger.new device
    @logger.level = ::Logger.const_get(level)
    @logger.datetime_format = '%Y-%m-%d %H:%M:%S '
  end

  @logger
end