Merge pull request #1643 from nasa/open1641

[Open 1641] Change warnings to info messages
This commit is contained in:
Pete Richards 2017-07-13 17:23:10 -07:00 committed by GitHub
commit 23839b05b0
4 changed files with 22 additions and 9 deletions

View File

@ -75,6 +75,21 @@ define(
].join(""));
}
//Log an info: defaults to "no service provide by"
function info(extension, category, message) {
var msg = message || "No service provided by";
$log.info([
msg,
" ",
category,
" ",
extension.key,
" from bundle ",
(extension.bundle || { path: "unknown bundle" }).path,
"; skipping."
].join(""));
}
// Echo arguments; used to represent groups of non-built-in
// extensions as a single dependency.
function echoMany() {
@ -161,13 +176,13 @@ define(
name = makeName("aggregator", service, index);
if (!service) {
return warn(aggregator, "aggregator");
return info(aggregator, "aggregator");
}
// Aggregators need other services to aggregate, otherwise they
// do nothing.
if (!latest[service]) {
return warn(
return info(
aggregator,
"aggregator",
"No services to aggregate for"

View File

@ -195,7 +195,8 @@ define(
expect(mockApp.service).not.toHaveBeenCalled();
// Should have gotten one warning for each skipped component
expect(mockLog.warn.calls.length).toEqual(3);
expect(mockLog.warn.calls.length).toEqual(2);
expect(mockLog.info.calls.length).toEqual(1);
});
it("warns about and skips aggregators with zero providers", function () {
@ -217,7 +218,7 @@ define(
expect(mockApp.service).not.toHaveBeenCalled();
// Should have gotten a warning
expect(mockLog.warn).toHaveBeenCalled();
expect(mockLog.info).toHaveBeenCalled();
});
it("warns about and skips decorators with nothing to decorate", function () {

View File

@ -115,9 +115,7 @@ define(
return (this.telemetryService =
$injector.get("telemetryService"));
} catch (e) {
// $injector should throw if telemetryService
// is unavailable or unsatisfiable.
$log.warn("Telemetry service unavailable");
$log.info("Telemetry service unavailable");
return (this.telemetryService = null);
}
};
@ -314,4 +312,3 @@ define(
return TelemetryCapability;
}
);

View File

@ -199,7 +199,7 @@ define(
telemetry.requestData();
expect(mockLog.warn).toHaveBeenCalled();
expect(mockLog.info).toHaveBeenCalled();
});
it("if a new style telemetry source is available, use it", function () {