logstash-plugins / logstash-mixin-deprecation_logger_support

An API-stable deprecation logger adapter for plugins to use, backed by the deprecation logger introduced in Logstash 7.6 or falling through to the plugin's logger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecation Logger Support Mixin

This gem provides an API-compatible implementation of the Logstash Deprecation Logger introduced in Logstash v7.6. It can be added as a dependency of any plugin that wishes to use the deprecation logger while still supporting older Logstash versions.

Usage

  1. Add this gem as a runtime dependency of your plugin:

    Gem::Specification.new do |s|
      # ...
    
      s.add_runtime_dependency 'logstash-mixin-deprecation_logger_support', '~>1.0'
    end
  2. In your plugin code, require this library and include it into your class or module that already inherits LogStash::Util::Loggable:

    require 'logstash/plugin_mixins/deprecation_logger_support'
    
    class LogStash::Inputs::Foo < Logstash::Inputs::Base
      include LogStash::PluginMixins::DeprecationLoggerSupport
    
      # ...
    end
  3. Use the deprecation logger; your plugin does not need to know whether the deprecation logger was provided by Logstash core or by this gem.

      def register
        deprecation_logger.deprecated("your message")
      end

Development

This gem:

  • MUST remain API-stable at 1.x
  • MUST NOT introduce additional runtime dependencies

About

An API-stable deprecation logger adapter for plugins to use, backed by the deprecation logger introduced in Logstash 7.6 or falling through to the plugin's logger

License:Apache License 2.0


Languages

Language:Ruby 100.0%