diff --git a/packages/aws-amplify/src/Common/ServiceWorker/ServiceWorker.ts b/packages/aws-amplify/src/Common/ServiceWorker/ServiceWorker.ts index 1538b410b44..96d40891c76 100644 --- a/packages/aws-amplify/src/Common/ServiceWorker/ServiceWorker.ts +++ b/packages/aws-amplify/src/Common/ServiceWorker/ServiceWorker.ts @@ -10,8 +10,7 @@ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ -import { ConsoleLogger as Logger } from '../../Common'; -import Analytics from '../../Analytics'; +import { ConsoleLogger as Logger, Amplify } from '../../Common'; /** * Provides a means to registering a service worker in the browser @@ -41,7 +40,7 @@ class ServiceWorkerClass { private _subscription: PushSubscription; // The AWS Amplify logger - private _logger: Logger = new Logger('ServiceWorker', 'DEBUG'); + private _logger: Logger = new Logger('ServiceWorker'); constructor() { } @@ -173,7 +172,7 @@ class ServiceWorkerClass { this._serviceWorker.addEventListener('statechange', event => { const currentState = this._serviceWorker.state; this._logger.debug(`ServiceWorker statechange: ${currentState}`); - Analytics.record('ServiceWorker', { + Amplify.Analytics.record('ServiceWorker', { 'state': currentState }); });