UNPKG

@daml/hub-react

Version:

Daml React functions for Daml Hub

54 lines 2.07 kB
"use strict"; var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; Object.defineProperty(exports, "__esModule", { value: true }); function prefixLog(name, logLevel) { return "".concat(logLevel.toUpperCase(), " [damlhub-react:").concat(name, "]"); } exports.default = (function (name) { return { debug: function () { var data = []; for (var _i = 0; _i < arguments.length; _i++) { data[_i] = arguments[_i]; } console.debug.apply(console, __spreadArray([prefixLog(name, 'debug')], data, false)); }, log: function () { var data = []; for (var _i = 0; _i < arguments.length; _i++) { data[_i] = arguments[_i]; } console.log.apply(console, __spreadArray([prefixLog(name, 'log')], data, false)); }, info: function () { var data = []; for (var _i = 0; _i < arguments.length; _i++) { data[_i] = arguments[_i]; } console.info.apply(console, __spreadArray([prefixLog(name, 'info')], data, false)); }, warn: function () { var data = []; for (var _i = 0; _i < arguments.length; _i++) { data[_i] = arguments[_i]; } console.warn.apply(console, __spreadArray([prefixLog(name, 'warn')], data, false)); }, error: function () { var data = []; for (var _i = 0; _i < arguments.length; _i++) { data[_i] = arguments[_i]; } console.error.apply(console, __spreadArray([prefixLog(name, 'error')], data, false)); }, }; }); //# sourceMappingURL=log.js.map