Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Open 1641] Change warnings to info messages #1643

Merged
merged 3 commits into from
Jul 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions platform/framework/src/register/ServiceCompositor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions platform/framework/test/register/ServiceCompositorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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 () {
Expand Down
5 changes: 1 addition & 4 deletions platform/telemetry/src/TelemetryCapability.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down Expand Up @@ -314,4 +312,3 @@ define(
return TelemetryCapability;
}
);

2 changes: 1 addition & 1 deletion platform/telemetry/test/TelemetryCapabilitySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down