lib/logops.js
function setLevel(level) {
    opts.level = level;
    let logLevelIndex = levels.indexOf(opts.level.toUpperCase());

    levels.forEach((logLevel) => {
      let fn;
      if (logLevelIndex <= levels.indexOf(logLevel)) {
        fn = logWrap(logLevel);
      } else {
        fn = noop;
      }
      API[logLevel.toLowerCase()] = fn;
    });
  }
function setLevel(level) {
    opts.level = level;
    let logLevelIndex = levels.indexOf(opts.level.toUpperCase());

    levels.forEach((logLevel) => {
      let fn;
      if (logLevelIndex <= levels.indexOf(logLevel)) {
        fn = logWrap(logLevel);
      } else {
        fn = noop;
      }
      API[logLevel.toLowerCase()] = fn;
    });
  }
function setLevel ( level ) { opts . level = level ; let logLevelIndex = levels . indexOf ( opts . level . toUpperCase ( ) ) ; levels . forEach ( ( logLevel ) => { let fn ; if ( logLevelIndex <= levels . indexOf ( logLevel ) ) { fn = logWrap ( logLevel ) ; } else { fn = noop ; } API [ logLevel . toLowerCase ( ) ] = fn ; } ) ; }
Sets the enabled logging level.
All the disabled logging methods are replaced by a noop,
so there is not any performance penalty at production using an undesired level

@param {String} level
Sets the enabled logging level . All the disabled logging methods are replaced by a noop so there is not any performance penalty at production using an undesired level