'use strict';

var Logger = (function _Logger() {
  var logger = {};

  var Color = {
    GREEN_FG: '\x1b[32m',
    RED_FG: '\x1b[31m',
    RESET:  '\x1b[0m',
    YELLOW_FG: '\x1b[33m'
  };

    logger.init = function(callback) {
      console.log.apply(this, ['%s [✔] %s [%s]: ' + 'Logger is configured', Color.GREEN_FG, Color.RESET, Date(Date.now())]);

      if(callback && typeof callback == 'function') { return callback(); }
    };
    logger.close = function() {};
    logger.log = console.log;
    logger.info = function() {
      var args = [].slice.call(arguments);

      console.log.apply(this, ['%s [i] %s [%s]: ' + args.shift(), Color.YELLOW_FG, Color.RESET, Date(Date.now())].concat(args));
    };
    logger.OK = function() {
      var args = [].slice.call(arguments);

      console.log.apply(this, ['%s [✔] %s [%s]: ' + args.shift(), Color.GREEN_FG, Color.RESET, Date(Date.now())].concat(args));
    };
    logger.error = function() {
      var args = [].slice.call(arguments);

      console.error.apply(this, ['%s [x] %s [%s]: ' + args.shift(), Color.RED_FG, Color.RESET, Date(Date.now())].concat(args));
    };
    logger.new = function() {
      return new _Logger();
    };

  return logger;
})();

module.exports = Logger;

@@ -101,24 +101,52 @@
 '%5Cx1b%5B32m',%0A
+    MAGENTA_FG: '%5Cx1b%5B35m',%0A
     RED_FG: 
@@ -218,334 +218,53 @@
 %0A%0A  
-  logger.init = function(callback) %7B%0A      console.log.apply(this, %5B'%25s %5B%E2%9C%94%5D %25s %5B%25s%5D: ' + 'Logger is configured', Color.GREEN_FG, Color.RESET, Date(Date.now())%5D);%0A%0A      if(callback && typeof callback == 'function') %7B return callback(); %7D%0A    %7D;%0A    logger.close = function(
+function colorLogger(tag, color
 ) %7B
-%7D;
 %0A    
-logger.log = console.log;%0A    logger.info =
+return
  fun
@@ -308,33 +308,32 @@
 all(arguments);%0A
-%0A
       console.lo
@@ -340,28 +340,28 @@
 g.apply(
-this
+null
 , %5B'%25s %5B
 i%5D %25s %5B%25
@@ -352,17 +352,18 @@
 , %5B'%25s %5B
-i
+%25s
 %5D %25s %5B%25s
@@ -387,23 +387,18 @@
 (), 
-C
+c
 olor
-.YELLOW_FG
+, tag
 , Co
@@ -438,36 +438,38 @@
 at(args));%0A    %7D
-;
 %0A  
+%7D%0A%0A
   logger.OK = fu
@@ -465,10 +465,12 @@
 ger.
-OK
+init
  = f
@@ -481,193 +481,170 @@
 ion(
-) %7B%0A      var args = %5B%5D.slice.call(arguments);%0A%0A      console.log.apply(this, %5B'%25s %5B%E2%9C%94%5D %25s %5B%25s%5D: ' + args.shift(), Color.GREEN_FG, Color.RESET, Date(Date.now())%5D.concat(args));%0A    
+callback) %7B%0A    logger.OK('Logger is configured');%0A%0A    if(callback && typeof callback == 'function') %7B return callback(); %7D%0A  %7D;%0A  logger.close = function() %7B
 %7D;%0A
-  
   lo
@@ -648,21 +648,19 @@
  logger.
-error
+new
  = funct
@@ -675,246 +675,207 @@
     
-  var args = %5B%5D.slice.call(arguments
+return new _Logger(
 );%0A
-%0A
   
-    console.error.apply(this, %5B'%25s %5Bx%5D %25s %5B%25s%5D: ' + args.shift(), Color.RED_FG, Color.RESET, Date(Date.now())%5D.concat(args));%0A    %7D;%0A    logger.new = function() %7B%0A      return new _Logger();%0A    %7D
+%7D;%0A%0A  logger.log = console.log;%0A  logger.info = colorLogger('i', Color.YELLOW_FG);%0A  logger.OK = colorLogger('%E2%9C%94', Color.GREEN_FG);%0A  logger.error = colorLogger('x', Color.RED)
 ;%0A%0A 

refactor logger