Module: Fluent::PluginLoggerMixin
- Included in:
- Fluent::Plugin::BareOutput, Fluent::Plugin::Filter, Fluent::Plugin::Input, Fluent::Plugin::MultiOutput, Fluent::Plugin::Output, Test::Driver::OwnerDummy
- Defined in:
- lib/fluent/log.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
Returns the value of attribute log.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#log ⇒ Object
Returns the value of attribute log.
421 422 423 |
# File 'lib/fluent/log.rb', line 421 def log @log end |
Class Method Details
.included(klass) ⇒ Object
408 409 410 411 412 413 |
# File 'lib/fluent/log.rb', line 408 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 # 'log_level' will be warned as deprecated } end |
Instance Method Details
#configure(conf) ⇒ Object
423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/fluent/log.rb', line 423 def configure(conf) super if level = conf['@log_level'] unless @log.is_a?(PluginLogger) @log = PluginLogger.new($log.dup) end @log.level = level @log.optional_header = "[#{self.class.name}#{plugin_id_configured? ? "(" + @id + ")" : ""}] " @log.optional_attrs = {} end end |
#initialize ⇒ Object
415 416 417 418 419 |
# File 'lib/fluent/log.rb', line 415 def initialize super @log = $log # Use $log object directly by default end |
#start ⇒ Object
436 437 438 439 |
# File 'lib/fluent/log.rb', line 436 def start @log.reset super end |
#terminate ⇒ Object
441 442 443 444 |
# File 'lib/fluent/log.rb', line 441 def terminate super @log.reset end |