Class: SemanticLogger::SyncProcessor

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/semantic_logger/sync_processor.rb

Overview

Thread that submits and processes log requests

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(appenders = nil) ⇒ SyncProcessor

Returns a new instance of SyncProcessor.



35
36
37
# File 'lib/semantic_logger/sync_processor.rb', line 35

def initialize(appenders = nil)
  @appenders = appenders || Appenders.new(self.class.logger.dup)
end

Class Attribute Details

.loggerObject

Internal logger for SemanticLogger

For example when an appender is not working etc..
By default logs to $stderr


24
25
26
27
28
29
30
31
# File 'lib/semantic_logger/sync_processor.rb', line 24

def self.logger
  @logger ||=
    begin
      l      = SemanticLogger::Appender::IO.new($stderr, level: :warn)
      l.name = name
      l
    end
end

Instance Attribute Details

#appendersObject (readonly)

Returns the value of attribute appenders.



33
34
35
# File 'lib/semantic_logger/sync_processor.rb', line 33

def appenders
  @appenders
end

Instance Method Details

#startObject



39
40
41
# File 'lib/semantic_logger/sync_processor.rb', line 39

def start
  # NOP
end