UNPKG

839 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var logger_1 = require("./utils/logger");
4var queue = [];
5function debugLog(message) {
6 var meta = [];
7 for (var _i = 1; _i < arguments.length; _i++) {
8 meta[_i - 1] = arguments[_i];
9 }
10 if (process.env.DEBUG !== undefined) {
11 queue.push({
12 message: message,
13 meta: meta
14 });
15 }
16}
17exports.debugLog = debugLog;
18function printLogs() {
19 if (process.env.DEBUG !== undefined) {
20 queue.forEach(function (log) {
21 var _a;
22 (_a = logger_1.getLogger()).info.apply(_a, [log.message].concat(log.meta));
23 });
24 resetLogs();
25 }
26}
27exports.printLogs = printLogs;
28function resetLogs() {
29 queue = [];
30}
31exports.resetLogs = resetLogs;
32//# sourceMappingURL=debugging.js.map
\No newline at end of file