Parent

Class/Module Index [+]

Quicksearch

Fluent::Supervisor::LoggerInitializer

Public Class Methods

new(path, level, chuser, chgroup) click to toggle source
# File lib/fluent/supervisor.rb, line 23
def initialize(path, level, chuser, chgroup)
  @path = path
  @level = level
  @chuser = chuser
  @chgroup = chgroup
end

Public Instance Methods

init() click to toggle source
# File lib/fluent/supervisor.rb, line 30
def init
  if @path && @path != "-"
    @io = File.open(@path, "a")
    if @chuser || @chgroup
      chuid = @chuser ? `id -u #{@chuser}`.to_i : nil
      chgid = @chgroup ? `id -g #{@chgroup}`.to_i : nil
      File.chown(chuid, chgid, @path)
    end
  else
    @io = STDOUT
  end

  $log = Fluent::Log.new(@io, @level)

  $log.enable_color(false) if @path
  $log.enable_debug if @level <= Fluent::Log::LEVEL_DEBUG
end
reopen!() click to toggle source
# File lib/fluent/supervisor.rb, line 52
def reopen!
  if @path && @path != "-"
    @io.reopen(@path, "a")
  end
  self
end
stdout?() click to toggle source
# File lib/fluent/supervisor.rb, line 48
def stdout?
  @io == STDOUT
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.