UNPKG

@freelancercom/blue-harvest

Version:
19 lines 597 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.log = void 0; /** * Add a timestamped log to the test output. */ function log(text) { const enabled = process.env['ENABLE_LOGS'] === '1' || process.env['ENABLE_LOGS'] === 'true'; if (enabled) { const d = new Date(); const pad = (num) => { return (`0${num}`).slice(-2); }; const time = `[${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}]`; console.log(`${time} ${text}`); } } exports.log = log; //# sourceMappingURL=logger.js.map