EUS/modules/logger.js
tgpethan 1b54c54b83 Initial code commit
Put all code for the Open Source Github release up.
2019-09-07 15:57:59 +01:00

19 lines
No EOL
457 B
JavaScript

"use strict";
const fs = require("fs");
const chalk = require("chalk");
let d = new Date();
module.exports = {
log: function(type, emoji, text) {
d = new Date();
console.log(`${chalk.green(`[${timeNumbers(d.getHours())}:${timeNumbers(d.getMinutes())}:${timeNumbers(d.getSeconds())} - ${type}]`)} ${emoji} ${text}`)
}
}
function timeNumbers(inp) {
if (inp <= 9) {
return "0"+inp;
} else {
return inp;
}
}