lib/fluent/plugin/out_flowcounter_simple.rb in fluent-plugin-flowcounter-simple-0.0.2 vs lib/fluent/plugin/out_flowcounter_simple.rb in fluent-plugin-flowcounter-simple-0.0.3
- old
+ new
@@ -1,8 +1,13 @@
class Fluent::FlowCounterSimpleOutput < Fluent::Output
Fluent::Plugin.register_output('flowcounter_simple', self)
+ # To support log_level option implemented by Fluentd v0.10.43
+ unless method_defined?(:log)
+ define_method("log") { $log }
+ end
+
config_param :indicator, :string, :default => 'num'
config_param :unit, :string, :default => 'second'
config_param :comment, :string, :default => nil
attr_accessor :last_checked
@@ -65,10 +70,10 @@
end
def flush_emit(step)
count, @count = @count, 0
if count > 0
- $log.info @output_proc.call(count)
+ log.info @output_proc.call(count)
end
end
def start_watch
# for internal, or tests only