SuperLog.prototype.line = function() { if (this.hush === 'force') return false; var args = _.toArray(arguments); var line = args.shift(); if (line.substring(0, 4) === 'last') { if(this.padding.bottom < 1) this.padding.bottom = 1; if (line.substring(4, 5) === '-') { this.padding.bottom = parseInt(line.split('-')[1]) + 1; line = screen.height - parseInt(line.split('-')[1]); } else line = screen.height + 1; }else if (line.substring(0, 5) === 'first') { if(this.padding.top < 1) this.padding.top = 1; if (line.substring(5, 6) === '+') { this.padding.top = parseInt(line.split('-')[1]) + 1; line = parseInt(line.split('-')[1]); } else line = 1; } culinary.save().position(0, line).eraseLine(); culinary.write(args.join(' ')); culinary.restore(); }
SuperLog.prototype.task = function(plugin, task, status) { if (this.hush === 'force') return false; if (this.hasError) this.solve(); var type = { 'Less': 'yellow', 'Jade': 'magenta', 'Reso': 'cyan', 'Brow': 'blue' } culinary.save().position(0, 2).eraseLine(); try { this.templates.header(this.name, '|', time(), herb[type[plugin.substring(0, 4)]](plugin), task, status); } catch (e) { culinary.write(this.name, '|', time(), plugin, task); } culinary.restore(); this.addLog(herb.dim(time(true)), herb[type[plugin.substring(0, 4)]](plugin), task, status || '', 'done!'); this.notify('Task ' + plugin + ' ' + task + ' done!', plugin); }
_.each(message.split('\n'), function(line, index) { culinary.position(1, index + 5).eraseLine(); culinary.write(herb.yellow(line || ' ') + '\n'); })