imap-mailbox
Version:
Simple library to use and watch IMAP mailboxes
22 lines (21 loc) • 776 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const chalk_1 = __importDefault(require("chalk"));
class Logger {
constructor(logging = false) {
this.logging = logging;
}
log(message, color = 'white') {
if (this.logging) {
const title = chalk_1.default[color]('[ImapMailbox]');
let date = new Date(Date.now()).toLocaleString();
date = chalk_1.default.white(date);
message = chalk_1.default[color](message);
console.log(`${title} - ${date} - ${message}`);
}
}
}
exports.default = Logger;