Class: Log4r::ScribeOutputter

Inherits:
Outputter
  • Object
show all
Defined in:
lib/log4r/outputter/scribeoutputter.rb

Instance Attribute Summary collapse

Attributes inherited from Outputter

#formatter, #level, #name

Instance Method Summary collapse

Methods inherited from Outputter

[], []=, each, each_outputter, #flush, #only_at, stderr, stdout

Constructor Details

#initialize(_name, hash = {}) ⇒ ScribeOutputter

Returns a new instance of ScribeOutputter.



12
13
14
15
16
17
18
19
# File 'lib/log4r/outputter/scribeoutputter.rb', line 12

def initialize(_name, hash={})
  super(_name, hash)
  @host = (hash[:host] or hash[:host] or 'localhost')
  @port = (hash[:port] or hash[:port] or '1463')
  @category = (hash[:category] or hash[:category] or 'default')

  @client = Scribe.new("#{@host}:#{@port}", category=@category, add_newlines=false)
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



10
11
12
# File 'lib/log4r/outputter/scribeoutputter.rb', line 10

def category
  @category
end

#hostObject (readonly)

Returns the value of attribute host.



10
11
12
# File 'lib/log4r/outputter/scribeoutputter.rb', line 10

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



10
11
12
# File 'lib/log4r/outputter/scribeoutputter.rb', line 10

def port
  @port
end