# File lib/fluent/supervisor.rb, line 53 def initialize(path, level, chuser, chgroup, opts) @path = path @level = level @chuser = chuser @chgroup = chgroup @opts = opts end
# File lib/fluent/supervisor.rb, line 61 def init if @path && @path != "-" @io = File.open(@path, "a") if @chuser || @chgroup chuid = @chuser ? Supervisor.get_etc_passwd(@chuser).uid : nil chgid = @chgroup ? Supervisor.get_etc_group(@chgroup).gid : nil File.chown(chuid, chgid, @path) end else @io = STDOUT end $log = Fluent::Log.new(@io, @level, @opts) $log.enable_color(false) if @path $log.enable_debug if @level <= Fluent::Log::LEVEL_DEBUG end
# File lib/fluent/supervisor.rb, line 89 def level=(level) @level = level $log.level = level end
# File lib/fluent/supervisor.rb, line 82 def reopen! if @path && @path != "-" @io.reopen(@path, "a") end self end
# File lib/fluent/supervisor.rb, line 78 def stdout? @io == STDOUT end