Explorar o código

Add log when closing down uppy instance and removing a plugin

Artur Paikin %!s(int64=6) %!d(string=hai) anos
pai
achega
8a71dc58ee
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/core/Core.js

+ 3 - 0
src/core/Core.js

@@ -886,6 +886,7 @@ class Uppy {
    * @param {object} instance The plugin instance to remove.
    */
   removePlugin (instance) {
+    this.log(`Removing plugin ${instance.id}`)
     this.emit('plugin-remove', instance)
 
     if (instance.uninstall) {
@@ -908,6 +909,8 @@ class Uppy {
    * Uninstall all plugins and close down this Uppy instance.
    */
   close () {
+    this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`)
+
     this.reset()
 
     this._storeUnsubscribe()