mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 10:18:40 +00:00
core: Log versions of Uppy plugins for debugging (#1640)
* Log Core’s version in constructor, log each plugin’s version in .use() * Check that Plugin.VERSION exists before logging it * Log which DOM element we are mounting to
This commit is contained in:
parent
9731431913
commit
9c2bcc8df8
2 changed files with 7 additions and 1 deletions
|
|
@ -114,7 +114,7 @@ module.exports = class Plugin {
|
|||
}
|
||||
this._updateUI = debounce(this.rerender)
|
||||
|
||||
this.uppy.log(`Installing ${callerPluginName} to a DOM element`)
|
||||
this.uppy.log(`Installing ${callerPluginName} to a DOM element '${target}'`)
|
||||
|
||||
// clear everything inside the target container
|
||||
if (this.opts.replaceTargetContent) {
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ class Uppy {
|
|||
this.opts = Object.assign({}, defaultOptions, opts)
|
||||
this.opts.restrictions = Object.assign({}, defaultOptions.restrictions, this.opts.restrictions)
|
||||
|
||||
this.log(`Using Core v${this.constructor.VERSION}`)
|
||||
|
||||
// i18n
|
||||
this.translator = new Translator([ this.defaultLocale, this.opts.locale ])
|
||||
this.locale = this.translator.locale
|
||||
|
|
@ -910,6 +912,10 @@ class Uppy {
|
|||
throw new Error(msg)
|
||||
}
|
||||
|
||||
if (Plugin.VERSION) {
|
||||
this.log(`Using ${pluginId} v${Plugin.VERSION}`)
|
||||
}
|
||||
|
||||
this.plugins[plugin.type].push(plugin)
|
||||
plugin.install()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue