module Fluent::PluginLoggerMixin

Attributes

log[RW]

Public Class Methods

included(klass) click to toggle source
# File lib/fluent/log.rb, line 347
def self.included(klass)
  klass.instance_eval {
    desc 'Allows the user to set different levels of logging for each plugin.'
    config_param :log_level, :string, default: nil, alias: :@log_level
  }
end
new() click to toggle source
Calls superclass method
# File lib/fluent/log.rb, line 354
def initialize
  super

  @log = $log # Use $log object directly by default
end

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/log.rb, line 362
def configure(conf)
  super

  if @log_level
    unless @log.is_a?(PluginLogger)
      @log = PluginLogger.new($log)
    end
    @log.level = @log_level
  end
end