lib/fluent/plugin/out_metricsense.rb in fluent-plugin-metricsense-0.2.4 vs lib/fluent/plugin/out_metricsense.rb in fluent-plugin-metricsense-0.2.5
- old
+ new
@@ -34,10 +34,13 @@
end
class Backend
UpdateMode = MetricSenseOutput::UpdateMode
include Configurable
+
+ attr_accessor :log
+
def start
end
def shutdown
end
end
@@ -62,10 +65,14 @@
config_param :backend, :string
config_param :aggregate_interval, :time, :default => 60
+ unless method_defined?(:log)
+ define_method(:log) { $log }
+ end
+
def configure(conf)
super
if @remove_tag_prefix
@remove_tag_prefix = Regexp.new('^' + Regexp.escape(@remove_tag_prefix) + "\\.?")
@@ -90,9 +97,10 @@
# into X per minute
@aggregate_interval = @aggregate_interval.to_i / 60 * 60
@normalize_factor = @aggregate_interval / 60
@backend = be.new
+ @backend.log = log
@backend.configure(conf)
end
def start
@backend.start