Module: Logging

Overview

Loads the config file, the logger and the KermitPFC masterclass

Author:

  • Daniel Machado Fernandez

Version:

  • 1.0

Defined Under Namespace

Classes: Settings

Constant Summary collapse

KermitPFC =

its neccessary to build the gem and make it run

::KermitPFC

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loggerLogger

solve the problem with path controversia in the log file

Returns:

  • (Logger)

    the logger with the correct path of log.txt



23
24
25
26
27
28
29
# File 'lib/logging.rb', line 23

def self.logger 
  begin
  @logger ||= Logger.new('../log/log.txt','monthly')
  rescue
    @logger ||= Logger.new('./log/log.txt','monthly')
  end
end

Instance Method Details

#loggerLogger

offers the logger to the app

Returns:

  • (Logger)

    the logger



17
18
19
# File 'lib/logging.rb', line 17

def logger
  Logging.logger
end