Code coverage report for lib/logger.js

Statements: 78.57% (11 / 14)      Branches: 75% (3 / 4)      Functions: 60% (3 / 5)      Lines: 78.57% (11 / 14)      Ignored: none     

All files » lib/ » logger.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49      1       1 24       1         1 1       1 25   25       25     1                                
/* exported colors */
'use strict';
 
var colors = require('colors'),
    util   = require('util');
 
// writes info messages to the console
exports.info = function info() {
  console.log(format('green', arguments));
};
 
// writes warning messages to the console
exports.warn = function warn() {
  console.warn(format('yellow', arguments));
};
 
// writes error messages to the console
exports.error = function warn() {
  console.error(format('red', arguments));
};
 
// colorize strings and send to console.log
function format(color, messages) {
  var length = messages.length;
 
  Iif (length === 0 || typeof(color) !== 'string') {
    return;
  }
 
  return (util.format.apply(null, messages)[color]);
}
 
exports.banner = function banner() {
  util.puts([
    '',
    ' #####  ####   ####  #    #       #####  #####   ####  #    # #   #',
    '   #   #      #    # ##   #       #    # #    # #    #  #  #   # # ',
    '   #    ####  #    # # #  # ##### #    # #    # #    #   ##     #  ',
    '   #        # #    # #  # #       #####  #####  #    #   ##     #  ',
    '#  #        # #    # #   ##       #      #   #  #    #  #  #    #  ',
    '####   #####   ####  #    #       #      #    #  ####  #    #   #  ',
    ''
  ]
  .join('\n')
  .rainbow
  .bold
  );
};