Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@creativecreatorormaybenot
Copy link
Contributor

@creativecreatorormaybenot creativecreatorormaybenot commented Aug 4, 2019

Reason

It is generally pretty annoying to see prints in your logs from sources you do not control and in this case, any user could manually add print statements (or even better, other kinds of notifications) very easily.
More importantly, this actually becomes a problem when running multiple uploads simultaneously. Here is a list of issues I encountered:

  1. There is no indication as to which upload the print statement is referring to, it is just a continuous stream of EVENT StorageTaskEventType.progress and EVENT StorageTaskEventType.success.

  2. There is no way to disable these prints if I do not want them to clutter my logs.

  3. This does impact performance and that is a problem when considering the previous point.

  4. They seem to be delayed? I am not entirely sure about this, but I added an element to my UI that waited for Future.wait(futures), where futures was a list of onComplete's and that element showed that all uploads did complete long before the logging stopped.

Implementation

I decided to essentially do nothing for the implementation (only remove the print call) and here is why:

  • There already is a way to manually print the upload status. I simply added explanation of how to do this both to README.md and CHANGELOG.md.

  • I would need to add an implementation to the plugin to make this behavior optional out of the box, which seems redundant to me as there already is a stream that is meant to handle cases like this.

Conclusion

I feel like there is no good answer to the question "Why do we need to print the upload status out of the box in the first place?".
If the developer wants to know about their upload status, they should listen to the stream and this even encourages to find different, possibly better ways, to notify about the upload status than simply printing to the logs.

Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM

@collinjackson collinjackson merged commit 016637f into flutter:master Aug 4, 2019
@creativecreatorormaybenot creativecreatorormaybenot deleted the firebase-storage-remove-prints branch August 4, 2019 19:58
mithun-mondal pushed a commit to bKash-developer/archived_plugins that referenced this pull request Aug 6, 2019
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants