text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.getLogLevel = undefined;
  
  var _console = require('console');
  
  var _console2 = _interopRequireDefault(_console);
  
  var _arrify = require('arrify');
  
  var _arrify2 = _interopRequireDefault(_arrify);
  
  var _commonTags = require('common-tags');
  
  var _lodash = require('lodash');
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  
  var _require = require('../package.json'),
      version = _require.version;
  
  var shouldLog = {
    // fn called         logLevels
    info: getShouldLogFn('', 'debug', 'info'),
    warn: getShouldLogFn('', 'debug', 'info', 'warn'),
    error: getShouldLogFn('', 'debug', 'info', 'warn', 'error')
  };
  
  exports.default = getLogger;
  exports.getLogLevel = getLogLevel;
  
  
  function getLogger(logLevel) {
    return {
      error: getLogFn('error'),
      warn: getLogFn('warn'),
      info: getLogFn('info')
    };
  
    function getLogFn(name) {
      return function logFn() {
        if (shouldLog[name](process.env.LOG_LEVEL || logLevel)) {
          var message = getMessage.apply(undefined, arguments);
          _console2.default[name].apply(_console2.default, _toConsumableArray(message)); // eslint-disable-line no-console
        }
      };
    }
  }
  
  function getMessage(first) {
    for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      rest[_key - 1] = arguments[_key];
    }
  
    if ((0, _lodash.isPlainObject)(first) && first.message && first.ref) {
      return [].concat(_toConsumableArray((0, _arrify2.default)(first.message)), [getLink(first.ref), first.error], rest).filter(function (i) {
        return !!i;
      });
    } else {
      return [first].concat(rest);
    }
  }
  
  function getLink(ref) {
    return _commonTags.oneLineTrim`
      https://github.com/kentcdodds/nps/blob/v
      ${version}
      /other/ERRORS_AND_WARNINGS.md#
      ${ref}
    `;
  }
  
  function getShouldLogFn() {
    for (var _len2 = arguments.length, acceptableValues = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      acceptableValues[_key2] = arguments[_key2];
    }
  
    return function shouldLogWithLevel() {
      var logLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  
      logLevel = logLevel.toLowerCase();
      return !logLevel || (0, _lodash.includes)(acceptableValues, logLevel);
    };
  }
  
  function getLogLevel(_ref) {
    var silent = _ref.silent,
        logLevel = _ref.logLevel;
  
    return silent ? 'disable' : logLevel;
  }