Class: Triglav::Agent::Logger

Inherits:
ServerEngine::DaemonLogger
  • Object
show all
Defined in:
lib/triglav/agent/logger.rb

Overview

Logger class

require 'triglav/agent/logger'
logger = Logger.new('STDOUT', opts = {})

Instance Method Summary collapse

Constructor Details

#initialize(logdev, *args) ⇒ Logger

Returns a new instance of Logger



9
10
11
12
13
14
# File 'lib/triglav/agent/logger.rb', line 9

def initialize(logdev, *args)
  logdev = STDOUT if logdev == 'STDOUT'
  logdev = STDERR if logdev == 'STDERR'
  super(logdev, *args)
  @formatter = LogFormatter.new
end

Instance Method Details

#write(msg) ⇒ Object



16
17
18
# File 'lib/triglav/agent/logger.rb', line 16

def write(msg)
  @logdev.write msg
end