Class: Dynflow::LoggerAdapters::Simple

Inherits:
Abstract
  • Object
show all
Defined in:
lib/dynflow/logger_adapters/simple.rb

Defined Under Namespace

Classes: ProgNameWrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output = $stdout, level = Logger::DEBUG, formatters = [Formatters::Exception]) ⇒ Simple

Returns a new instance of Simple.



10
11
12
13
14
15
16
# File 'lib/dynflow/logger_adapters/simple.rb', line 10

def initialize(output = $stdout, level = Logger::DEBUG, formatters = [Formatters::Exception])
  @logger           = Logger.new(output)
  @logger.level     = level
  @logger.formatter = method(:formatter).to_proc
  @action_logger    = apply_formatters ProgNameWrapper.new(@logger, ' action'), formatters
  @dynflow_logger   = apply_formatters ProgNameWrapper.new(@logger, 'dynflow'), formatters
end

Instance Attribute Details

#action_loggerObject (readonly)

Returns the value of attribute action_logger.



8
9
10
# File 'lib/dynflow/logger_adapters/simple.rb', line 8

def action_logger
  @action_logger
end

#dynflow_loggerObject (readonly)

Returns the value of attribute dynflow_logger.



8
9
10
# File 'lib/dynflow/logger_adapters/simple.rb', line 8

def dynflow_logger
  @dynflow_logger
end

#loggerObject (readonly)

Returns the value of attribute logger.



8
9
10
# File 'lib/dynflow/logger_adapters/simple.rb', line 8

def logger
  @logger
end

Instance Method Details

#levelObject



18
19
20
# File 'lib/dynflow/logger_adapters/simple.rb', line 18

def level
  @logger.level
end

#level=(v) ⇒ Object



22
23
24
# File 'lib/dynflow/logger_adapters/simple.rb', line 22

def level=(v)
  @logger.level = v
end