Class: DumpCleaner::Log

Inherits:
Logger
  • Object
show all
Includes:
Singleton
Defined in:
lib/dump_cleaner/log.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLog

Returns a new instance of Log.



11
12
13
14
15
16
# File 'lib/dump_cleaner/log.rb', line 11

def initialize
  super($stdout)

  init_log_level
  self.formatter = ->(severity, datetime, _progname, msg) { "#{datetime} #{severity}: #{msg}\n" }
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



9
10
11
# File 'lib/dump_cleaner/log.rb', line 9

def logger
  @logger
end

Class Method Details

.debug(&block) ⇒ Object



22
23
24
# File 'lib/dump_cleaner/log.rb', line 22

def self.debug(&block)
  instance.debug(&block)
end

.error(&block) ⇒ Object



34
35
36
# File 'lib/dump_cleaner/log.rb', line 34

def self.error(&block)
  instance.error(&block)
end

.fatal(&block) ⇒ Object



38
39
40
# File 'lib/dump_cleaner/log.rb', line 38

def self.fatal(&block)
  instance.fatal(&block)
end

.info(&block) ⇒ Object



26
27
28
# File 'lib/dump_cleaner/log.rb', line 26

def self.info(&block)
  instance.info(&block)
end

.warn(&block) ⇒ Object



30
31
32
# File 'lib/dump_cleaner/log.rb', line 30

def self.warn(&block)
  instance.warn(&block)
end

Instance Method Details

#init_log_levelObject



18
19
20
# File 'lib/dump_cleaner/log.rb', line 18

def init_log_level
  self.level = Logger::INFO
end