crunchy
Version:
Crunchy is a fork of Crunchyroll.js, capable of downloading anime episodes from the popular CrunchyRoll streaming service.
46 lines • 1.36 kB
JavaScript
;
exports.__esModule = true;
var fs = require("fs-extra");
function error(str) {
/* Do fancy output */
console.error(' \x1B[1;31m* ERROR\x1B[0m: ' + str);
}
exports.error = error;
function info(str) {
/* Do fancy output */
console.log(' \x1B[1;32m* INFO \x1B[0m: ' + str);
}
exports.info = info;
function debug(str) {
/* Do fancy output */
console.log(' \x1B[1;35m* DEBUG\x1B[0m: ' + str);
}
exports.debug = debug;
function warn(str) {
/* Do fancy output */
console.log(' \x1B[1;33m* WARN \x1B[0m: ' + str);
}
exports.warn = warn;
function warnMore(str) {
/* Do fancy output */
console.log(' \x1B[1;38;5;166m* WARN \x1B[0m: ' + str);
}
exports.warnMore = warnMore;
function dispEpisode(name, status, addNL) {
/* Do fancy output */
process.stdout.write('\x1B[K \x1B[1;33m> \x1B[37m' + name + '\x1B[0m : \x1B[33m' + status + '\x1B[0m\x1B[0G');
if (addNL) {
console.log('');
}
}
exports.dispEpisode = dispEpisode;
function dumpToDebug(what, data, create) {
if (create === void 0) { create = false; }
if (create) {
fs.writeFileSync('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n');
return;
}
fs.appendFileSync('debug.txt', '>>>>>>>> ' + what + ':\n' + data + '\n<<<<<<<<\n');
}
exports.dumpToDebug = dumpToDebug;
//# sourceMappingURL=log.js.map