iptv/scripts/helpers/log.js

18 lines
327 B
JavaScript
Raw Normal View History

2021-08-01 07:25:44 +02:00
const log = {}
2021-08-18 15:37:47 +02:00
log.print = function (message) {
if (typeof message === 'object') message = JSON.stringify(message, null, 2)
process.stdout.write(message)
2021-08-01 07:25:44 +02:00
}
log.start = function () {
this.print('Starting...\n')
2021-08-01 18:45:15 +02:00
console.time('Done in')
2021-08-01 07:25:44 +02:00
}
log.finish = function () {
2021-08-01 18:45:15 +02:00
console.timeEnd('Done in')
2021-08-01 07:25:44 +02:00
}
module.exports = log