[6a3a178] | 1 | "use strict";
|
---|
| 2 | /**
|
---|
| 3 | * @license
|
---|
| 4 | * Copyright Google LLC All Rights Reserved.
|
---|
| 5 | *
|
---|
| 6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 7 | * found in the LICENSE file at https://angular.io/license
|
---|
| 8 | */
|
---|
| 9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 10 | exports.LoggingAnalytics = void 0;
|
---|
| 11 | /**
|
---|
| 12 | * Analytics implementation that logs analytics events to a logger. This should be used for
|
---|
| 13 | * debugging mainly.
|
---|
| 14 | */
|
---|
| 15 | class LoggingAnalytics {
|
---|
| 16 | constructor(_logger) {
|
---|
| 17 | this._logger = _logger;
|
---|
| 18 | }
|
---|
| 19 | event(category, action, options) {
|
---|
| 20 | this._logger.info('event ' + JSON.stringify({ category, action, ...options }));
|
---|
| 21 | }
|
---|
| 22 | screenview(screenName, appName, options) {
|
---|
| 23 | this._logger.info('screenview ' + JSON.stringify({ screenName, appName, ...options }));
|
---|
| 24 | }
|
---|
| 25 | pageview(path, options) {
|
---|
| 26 | this._logger.info('pageview ' + JSON.stringify({ path, ...options }));
|
---|
| 27 | }
|
---|
| 28 | timing(category, variable, time, options) {
|
---|
| 29 | this._logger.info('timing ' + JSON.stringify({ category, variable, time, ...options }));
|
---|
| 30 | }
|
---|
| 31 | flush() {
|
---|
| 32 | return Promise.resolve();
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 | exports.LoggingAnalytics = LoggingAnalytics;
|
---|