Module: Aebus::Logging

Included in:
Core
Defined in:
lib/aebus/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.log_to_file(file) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/aebus/logging.rb', line 15

def self.log_to_file(file)
  begin
    @logger = Logger.new(file, 'daily')
  rescue Errno::EACCES => e
    logger.warn("Could not create log file, '#{e.message}'. Defaulting to STDOUT")
  end
end

.loggerObject



11
12
13
# File 'lib/aebus/logging.rb', line 11

def self.logger
  @logger ||= Logger.new(STDOUT)
end

Instance Method Details

#loggerObject



7
8
9
# File 'lib/aebus/logging.rb', line 7

def logger
  Logging.logger
end