From 19b5e7c781025f2e8af2c1e0f903a6337f2fac8a Mon Sep 17 00:00:00 2001 From: Luis Schubert Date: Thu, 6 Jul 2017 15:55:29 -0700 Subject: [PATCH 1/3] [Open 1641] Change warnings to info messages --- .../src/register/ServiceCompositor.js | 19 +++++++++++++++++-- platform/telemetry/src/TelemetryCapability.js | 3 +-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/platform/framework/src/register/ServiceCompositor.js b/platform/framework/src/register/ServiceCompositor.js index 4e6d9b6a5e..50fb491eb5 100644 --- a/platform/framework/src/register/ServiceCompositor.js +++ b/platform/framework/src/register/ServiceCompositor.js @@ -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" diff --git a/platform/telemetry/src/TelemetryCapability.js b/platform/telemetry/src/TelemetryCapability.js index f784f59ffc..19921c08bb 100644 --- a/platform/telemetry/src/TelemetryCapability.js +++ b/platform/telemetry/src/TelemetryCapability.js @@ -117,7 +117,7 @@ define( } 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 +314,3 @@ define( return TelemetryCapability; } ); - From fb0a577d161aee8d64d755b5ff51453626bc8914 Mon Sep 17 00:00:00 2001 From: Luis Schubert Date: Mon, 10 Jul 2017 09:46:51 -0700 Subject: [PATCH 2/3] [Open1641] Updated the spec files to check for info messages instead of warning messages --- platform/framework/test/register/ServiceCompositorSpec.js | 5 +++-- platform/telemetry/test/TelemetryCapabilitySpec.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/framework/test/register/ServiceCompositorSpec.js b/platform/framework/test/register/ServiceCompositorSpec.js index f2450e6ca8..8dc40f2adc 100644 --- a/platform/framework/test/register/ServiceCompositorSpec.js +++ b/platform/framework/test/register/ServiceCompositorSpec.js @@ -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 () { diff --git a/platform/telemetry/test/TelemetryCapabilitySpec.js b/platform/telemetry/test/TelemetryCapabilitySpec.js index c9ea459039..b3b9c7b889 100644 --- a/platform/telemetry/test/TelemetryCapabilitySpec.js +++ b/platform/telemetry/test/TelemetryCapabilitySpec.js @@ -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 () { From efc46613bbba5ae8182974dc441d9385c9c2c9d9 Mon Sep 17 00:00:00 2001 From: Luis-Johannes Schubert Date: Thu, 13 Jul 2017 16:47:24 -0700 Subject: [PATCH 3/3] Updated TelemetryCapability.js removed outdated comment. --- platform/telemetry/src/TelemetryCapability.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/platform/telemetry/src/TelemetryCapability.js b/platform/telemetry/src/TelemetryCapability.js index 19921c08bb..94fe0cebb4 100644 --- a/platform/telemetry/src/TelemetryCapability.js +++ b/platform/telemetry/src/TelemetryCapability.js @@ -115,8 +115,6 @@ define( return (this.telemetryService = $injector.get("telemetryService")); } catch (e) { - // $injector should throw if telemetryService - // is unavailable or unsatisfiable. $log.info("Telemetry service unavailable"); return (this.telemetryService = null); }