giles
Version:
a next-gen language watcher/compiler for pre-processed languages
72 lines (61 loc) • 2.12 kB
JavaScript
// Generated by CoffeeScript 1.6.2
(function() {
var clc, quiet,
__slice = [].slice;
clc = require('cli-color');
quiet = false;
module.exports = {
error: function() {
var message, more;
message = arguments[0], more = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (!quiet) {
return console.log(clc.red.bold("[ ERROR ] ", more) + message);
}
},
warn: function() {
var message, more;
message = arguments[0], more = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (!quiet) {
return console.log(clc.yellow.bold("[ WARN ] ", more) + message);
}
},
notice: function() {
var message, more;
message = arguments[0], more = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (!quiet) {
return console.log(clc.cyan.bold("[ NOTICE ] ", more) + message);
}
},
info: function() {
var message, more;
message = arguments[0], more = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (!quiet) {
return console.log(clc.cyan.bold("[ INFO ] ", more) + message);
}
},
log: function() {
var message, more;
message = arguments[0], more = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if (more.length > 0) {
return console.log(message, more);
} else {
return console.log(message);
}
},
encourage: function() {
var array, goodjob, words;
array = ["That's quite good, what you've done.", "Most acceptable.", "You are quite good when you focus.", "Well, I didn't quite expect you to do that well.", "You have saved the world, again.", "They came after me, but I was more than a match for them."];
goodjob = clc.green.bold("[GOOD JOB] ");
words = clc.green(array[Math.floor(Math.random() * array.length)]);
if (!quiet) {
return console.log(goodjob + words);
}
},
quiet: function(bool) {
if (bool == null) {
bool = true;
}
return quiet = bool;
}
};
}).call(this);