Class: LSync::TeeLogger

Inherits:
Object
  • Object
show all
Includes:
TeeHelper
Defined in:
lib/lsync/tee_logger.rb

Overview

The tee logger provides a simple split logging system where multiple logs may receive the same messages. These logs can route messages to different destinations using different formatting.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TeeHelper

#tee

Constructor Details

#initialize(*loggers) ⇒ TeeLogger

Returns a new instance of TeeLogger.


32
33
34
# File 'lib/lsync/tee_logger.rb', line 32

def initialize(*loggers)
	@loggers = Set.new(loggers.flatten.compact)
end

Instance Attribute Details

#loggersObject (readonly)

Returns the value of attribute loggers


36
37
38
# File 'lib/lsync/tee_logger.rb', line 36

def loggers
  @loggers
end

Class Method Details

.logger_methodsObject


38
39
40
# File 'lib/lsync/tee_logger.rb', line 38

def self.logger_methods
	Set.new(Logger.instance_methods) - Set.new(Object.instance_methods + %w(tee))
end