Class: TTK::LoggerFactory

Inherits:
Object show all
Defined in:
lib/ttk/logger_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLoggerFactory

Returns a new instance of LoggerFactory.



11
12
13
14
15
16
17
# File 'lib/ttk/logger_factory.rb', line 11

def initialize
  @section_tree = create_section_tree
  @severity_level = Logger::Severity::DEBUG
  @verbosity = Logger::Verbosity.new
  @verbosity_level = 0
  @active_section = []
end

Instance Attribute Details

#active_sectionObject

Returns the value of attribute active_section.



23
24
25
# File 'lib/ttk/logger_factory.rb', line 23

def active_section
  @active_section
end

#section_treeObject

Returns the value of attribute section_tree.



25
26
27
# File 'lib/ttk/logger_factory.rb', line 25

def section_tree
  @section_tree
end

#severity_levelObject

Returns the value of attribute severity_level.



21
22
23
# File 'lib/ttk/logger_factory.rb', line 21

def severity_level
  @severity_level
end

#verbosity_levelObject

Returns the value of attribute verbosity_level.



19
20
21
# File 'lib/ttk/logger_factory.rb', line 19

def verbosity_level
  @verbosity_level
end

Instance Method Details

#create(*a, &b) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/ttk/logger_factory.rb', line 27

def create(*a, &b)
  log = Logger.new(*a, &b)
  log.severity_level = @severity_level
  log.verbosity_level = @verbosity_level
  log.section_tree = @section_tree
  log.active_section(true, *@active_section)
  log
end