Class: Riserva::Log

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLog

Returns a new instance of Log.



9
10
11
12
13
14
15
16
17
18
# File 'lib/riserva/log.rb', line 9

def initialize
  @logger = Logger.new(
    Riserva::Config.read('log.filename') || STDOUT,
    Riserva::Config.read('log.files_to_keep') || 1,
    Riserva::Config.read('log.size') || 100 * 1024
  )

  @logger.datetime_format = datetime_format
  @logger.formatter = formatter
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



7
8
9
# File 'lib/riserva/log.rb', line 7

def logger
  @logger
end