Class: ZTK::Logger::LogDevice

Inherits:
Object
  • Object
show all
Defined in:
lib/ztk/logger.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (LogDevice) initialize(chain)

Returns a new instance of LogDevice



60
61
62
63
64
# File 'lib/ztk/logger.rb', line 60

def initialize(chain)
  @chain    = chain
  @dev      = nil
  @filename = nil
end

Instance Attribute Details

- (Object) dev (readonly)

Returns the value of attribute dev



57
58
59
# File 'lib/ztk/logger.rb', line 57

def dev
  @dev
end

- (Object) filename (readonly)

Returns the value of attribute filename



58
59
60
# File 'lib/ztk/logger.rb', line 58

def filename
  @filename
end

Instance Method Details

- (Object) close



72
73
74
75
76
# File 'lib/ztk/logger.rb', line 72

def close
  @chain.loggers.each do |logger|
    logger.instance_variable_get(:@logdev).close
  end
end

- (Object) write(message)



66
67
68
69
70
# File 'lib/ztk/logger.rb', line 66

def write(message)
  @chain.loggers.each do |logger|
    logger << message
  end
end