lib/fluent/plugin/out_gcloud_pubsub.rb in fluent-plugin-gcloud-pubsub-0.0.2 vs lib/fluent/plugin/out_gcloud_pubsub.rb in fluent-plugin-gcloud-pubsub-0.0.3
- old
+ new
@@ -12,10 +12,11 @@
config_set_default :buffer_queue_limit, 64
config_param :project, :string, :default => nil
config_param :topic, :string, :default => nil
config_param :key, :string, :default => nil
+ config_param :autocreate_topic, :bool, :default => false
unless method_defined?(:log)
define_method("log") { $log }
end
@@ -33,10 +34,10 @@
def start
super
pubsub = (Gcloud.new @project, @key).pubsub
- @client = pubsub.topic @topic
+ @client = pubsub.topic @topic, autocreate: @autocreate_topic
end
def format(tag, time, record)
[tag, time, record].to_msgpack
end