@grafana/faro-web-sdk
Version:
Faro instrumentations, metas, transports for web.
37 lines • 1.73 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsoleTransport = void 0;
var faro_core_1 = require("@grafana/faro-core");
var ConsoleTransport = /** @class */ (function (_super) {
__extends(ConsoleTransport, _super);
function ConsoleTransport(options) {
if (options === void 0) { options = {}; }
var _this = _super.call(this) || this;
_this.options = options;
_this.name = '@grafana/faro-web-sdk:transport-console';
_this.version = faro_core_1.VERSION;
return _this;
}
ConsoleTransport.prototype.send = function (item) {
var _a;
return this.unpatchedConsole[(_a = this.options.level) !== null && _a !== void 0 ? _a : faro_core_1.LogLevel.DEBUG]('New event', (0, faro_core_1.getTransportBody)([item]));
};
return ConsoleTransport;
}(faro_core_1.BaseTransport));
exports.ConsoleTransport = ConsoleTransport;
//# sourceMappingURL=transport.js.map