mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 23:53:49 +00:00
[API] Fix logging of paths
When extensions have an explicitly-declared implementation, do not log that they are being loaded.
This commit is contained in:
@ -133,7 +133,7 @@ define(
|
|||||||
* @returns {string} path to implementation, or undefined
|
* @returns {string} path to implementation, or undefined
|
||||||
*/
|
*/
|
||||||
Extension.prototype.getImplementationPath = function () {
|
Extension.prototype.getImplementationPath = function () {
|
||||||
return this.definition.implementation ?
|
return (this.hasImplementation() && !this.hasImplementationValue()) ?
|
||||||
this.bundle.getSourcePath(this.definition.implementation) :
|
this.bundle.getSourcePath(this.definition.implementation) :
|
||||||
undefined;
|
undefined;
|
||||||
};
|
};
|
||||||
|
@ -61,10 +61,9 @@ define(
|
|||||||
$log = this.$log;
|
$log = this.$log;
|
||||||
|
|
||||||
function loadImplementation(extension) {
|
function loadImplementation(extension) {
|
||||||
var implPath = extension.getImplementationPath(),
|
var implPromise = extension.hasImplementationValue() ?
|
||||||
implPromise = extension.hasImplementationValue() ?
|
|
||||||
Promise.resolve(extension.getImplementationValue()) :
|
Promise.resolve(extension.getImplementationValue()) :
|
||||||
loader.load(implPath),
|
loader.load(extension.getImplementationPath()),
|
||||||
definition = extension.getDefinition();
|
definition = extension.getDefinition();
|
||||||
|
|
||||||
// Wrap a constructor function (to avoid modifying the original)
|
// Wrap a constructor function (to avoid modifying the original)
|
||||||
@ -119,13 +118,15 @@ define(
|
|||||||
return extension.getDefinition();
|
return extension.getDefinition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!extension.hasImplementationValue()) {
|
||||||
// Log that loading has begun
|
// Log that loading has begun
|
||||||
$log.info([
|
$log.info([
|
||||||
"Loading implementation ",
|
"Loading implementation ",
|
||||||
implPath,
|
extension.getImplementationPath(),
|
||||||
" for extension ",
|
" for extension ",
|
||||||
extension.getLogName()
|
extension.getLogName()
|
||||||
].join(""));
|
].join(""));
|
||||||
|
}
|
||||||
|
|
||||||
return implPromise.then(attachDefinition, handleError);
|
return implPromise.then(attachDefinition, handleError);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user