When I drafted the logging usage doc, I assumed that users would want to pass in a string identifying the bucket, bigquery dataset, or pubsub topic, to which log entries would be exported, and I guessed at three properties, storage_bucket, bigquery_dataset, and pubsub_topic, which would consume and validate those strings.
Now, while working on the implementation, I believe that it might be better to have a destination property, whose setter would be willing to take any of:
- a string (it would do no validation, but just store it).
- a
Bucket instance
- a
Dataset instance
- a
Topic instance.
In the case of the last three, the destination property setter would synthesize the appropriate destination string and store it.
We would then be able to accept a destination argument to Sink.__init__ and Client.sink, which would just rely on the destination property setter.
Thoughts?
When I drafted the logging usage doc, I assumed that users would want to pass in a string identifying the bucket, bigquery dataset, or pubsub topic, to which log entries would be exported, and I guessed at three properties,
storage_bucket,bigquery_dataset, andpubsub_topic, which would consume and validate those strings.Now, while working on the implementation, I believe that it might be better to have a
destinationproperty, whose setter would be willing to take any of:BucketinstanceDatasetinstanceTopicinstance.In the case of the last three, the
destinationproperty setter would synthesize the appropriate destination string and store it.We would then be able to accept a
destinationargument toSink.__init__andClient.sink, which would just rely on thedestinationproperty setter.Thoughts?