1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var logger_1 = require("./utils/logger");
|
4 | var queue = [];
|
5 | function 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 | }
|
17 | exports.debugLog = debugLog;
|
18 | function 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 | }
|
27 | exports.printLogs = printLogs;
|
28 | function resetLogs() {
|
29 | queue = [];
|
30 | }
|
31 | exports.resetLogs = resetLogs;
|
32 |
|
\ | No newline at end of file |