Used to generate our custom loggers.

@function customLogEvent
@private

@param {string} level - The level to log the events.

@returns a function that logs what is passed.  Signature is: message, exception, data, settings.
189162
function customLogEvent(level) {

  // options should contain the appenders and handlers to override the
  // global ones defined in errorAppenders, and errorHandlers.
  // Used by Canadarm.localWatch to wrap local appender calls.
  return function (message, exception, data, settings) {

    // If we are are below the current Canadarm.loggingLevel we
    // should not do anything with the passed information.  Return
    // as if nothing happened.
    if (Canadarm.levelOrder.indexOf(level) < Canadarm.levelOrder.indexOf(Canadarm.loggingLevel)) {
      return;
    }

    var options = settings || {},
      attrs = gatherErrors(level, exception, message, data, options.appenders);
    pushErrors(attrs, options.handlers);
  };
}
606060
function ExceptionReporter(logger, level) {
    this.logger = logger;
    this.level = level || new Level('UNCAUGHT EXCEPTION', Infinity);
    this.exceptionHandler = this.onUncaughtException.bind(this);
}
705569
function log(level, message) {
  if(!~map[this._level].indexOf(level)) return false;
  var pid = process.pid
    , time = logtime()
    , args = slice.call(arguments, 1)
    , cb = typeof args[args.length - 1] === 'function'
      ? args.pop() : null
    , stream = level === LEVELS.WARNING ? this._err : this._out;
  var msg = '[' + pid + '] ' + time + ' '
    + getPrefix(level, stream.isTTY) + ' ';

  if(args.length > 1) {
    message = util.format.apply(util, args);
  }else{
    message = args[0];
  }
  msg += message + EOL;
  stream.write(msg, cb);
  return message;
}
1066017
function makeLogger(level, method) {
	// The logger function to return takes a variable number of arguments
	// and formats like console.log
	function logger() {
		var args = [].slice.call(arguments);
		var format = level.toUpperCase() + ': (api-client) ' + args.shift();
		var logArgs = [format].concat(args);

		return console[method].apply(console, logArgs);
	}

	return (level === 'warn' || level === 'error' || level === 'info')
		? logger
		: function() {};
}
1088917
function createLogger(name, options) {
        var log = typeof debug === 'undefined' ? _debug(name) : debug(name),
            level,
            levels = {
                silly: 0,
                input: 1,
                verbose: 2,
                prompt: 3,
                debug: 4,
                info: 5,
                data: 6,
                help: 7,
                warn: 8,
                error: 9
            };
        if (!options) {
            throw new Error('options required in logger');
        }
        if (options.hasOwnProperty('level') === false) {
            throw new Error('options.level required in logger');
        }
        level = levels[options.level];
        if (typeof level === 'undefined') {
            level = levels.info;
        }

        log.debug = function () {
            if (log.enabled && level <= levels.debug) {
                if (console.debug) {
                    log.log = console.debug.bind(console);
                } else {
                    log.log = console.log.bind(console);
                }
                log.apply(this, arguments);
            }
        };
        log.info = function () {
            if (log.enabled && level <= levels.info) {
                log.log = console.info.bind(console);
                log.apply(this, arguments);
            }
        };
        log.warn = function () {
            if (log.enabled && level <= levels.warn) {
                log.log = console.warn.bind(console);
                log.apply(this, arguments);
            }
        };
        log.error = function () {
            if (log.enabled && level <= levels.error) {
                log.log = console.error.bind(console);
                log.apply(this, arguments);
            } else {
                console.error.apply(console, arguments);
            }
        };

        log.fork = function (forkName, useForkName) {
            forkName = useForkName ? forkName : name + ':' + forkName;
            return createLogger(forkName, options);
        };

        log.forkWithOptions = function (_name, _options) {
            return createLogger(_name, _options);
        };

        return log;
    }
719486
public List<LogEvent> getLogs(LogLevel level)
    {
        List<LogEvent> levelLogs = new LinkedList<LogEvent>();

        for (LogEvent log : this) {
            if (log.getLevel() == level) {
                levelLogs.add(log);
            }
        }

        return levelLogs;
    }
242390
function logWrap(level) {
    return function log() {
      let context, message, args, trace, err;

      if (arguments[0] instanceof Error) {
        // log.<level>(err, ...)
        context = API.getContext();
        args = Array.prototype.slice.call(arguments, 1);
        if (!args.length) {
          // log.<level>(err)
          err = arguments[0];
          message = err.name + ': ' + err.message;
        } else {
          // log.<level>(err, "More %s", "things")
          // Use the err as context information
          err = arguments[0];
          message = arguments[1];
          args = Array.prototype.slice.call(args, 1);
        }
      } else if (arguments[0] == null || (typeof (arguments[0]) !== 'object' && arguments[0] !== null) ||
          Array.isArray(arguments[0])) {
        // log.<level>(msg, ...)
        context = API.getContext();
        message = arguments[0];
        args = Array.prototype.slice.call(arguments, 1);
      } else {
        // log.<level>(fields, msg, ...)
        context = merge(API.getContext(), arguments[0]);
        message = arguments[1];
        args = Array.prototype.slice.call(arguments, 2);
      }

      trace = API.format(level, context || {}, message, args, err);
      API.stream.write(trace + '\n');
    };
  }
508732
function parseLogLevel (logLevel) {
  if (!/debug|info|warn|error|off/i.test(logLevel)) {
    console.error('Log level must be one of the following (debug|info|warn|error|off)')
    process.exit(1)
  }
  return logLevel.toUpperCase()
}
254355
function logWithArgs(level, args) {
    args = [level].concat([].slice.call(args));
    logger.logLevel.apply(logger, args);
}
717704
function debug() {
  var args = [LEVELS.DEBUG].concat(slice.apply(arguments));
  return this.log.apply(this, args);
}
1097253
function (name, loggerContext) {
    /**
     * Logger name
     */
    this.name = name;

    /**
     * Reference to the logger context that created this logger
     *
     * The reference is used to create appenders and layouts when
     * configuration is applied.
     */
    this.loggerContext = loggerContext;

    /**
     * Parent logger. All loggers have a parent except the root logger
     */
    this.parent = null;

    /**
     * Children loggers. Mostly used during initialization to propagate
     * the configuration.
     */
    this.children = [];

    /**
     * Appenders associated with the logger. Set during initialization
     */
    this.appenders = [];

    /**
     * Logger filter. Set during initialization
     */
    this.filter = null;

    /**
     * The trace level of the logger. Log events whose level is below that
     * level are logged. Others are discarded.
     */
    this.level = 'inherit';

    /**
     * Additivity flag. Log events are not propagated to the parent logger
     * if the flag is not set.
     */
    this.additive = true;

    /**
     * Function used to determine whether a log level is below the
     * trace level of the logger
     */
    if (this.loggerContext) {
      this.isBelow = function (level, referenceLevel) {
        return this.loggerContext.logLevel.isBelow(level, referenceLevel);
      };

      // Set trace functions for all registered levels
      utils.each(this.loggerContext.logLevel.getLevels(), function (level) {
        var self = this;
        if (!this[level]) {
          this[level] = function () {
            self.traceAtLevel(level, arguments);
          };
        }
      }, this);
    }
    else {
      this.isBelow = function () {
        return true;
      };
    }
  }
250689
function log(message, level) {
    var prefix = "[" + colors.cyan("gulp-tslint") + "]";
    if (level === "error") {
        fancyLog(prefix, colors.red("error"), message);
    }
    else {
        fancyLog(prefix, message);
    }
}
591922
def log(self, level, msg=None, *args, **kwargs):
        """"""

        return self._log(level, msg, args, kwargs)
403093
function logLevelClass(level) {
        if (level) {
            var first = level[0];
            if (first === 'w' || first === "W") {
                return "warning";
            }
            else if (first === 'e' || first === "E") {
                return "error";
            }
            else if (first === 'i' || first === "I") {
                return "info";
            }
            else if (first === 'd' || first === "D") {
                // we have no debug css style
                return "";
            }
        }
        return "";
    }
880918
function CruxLogger(_type, _level) {
  if (this instanceof CruxLogger) {
    Component.apply(this, arguments);
    this.name = 'log';
    var hasColors = this.config.colors;
    delete this.config.colors;
    if (!hasColors) {
      for (var i = 0; i < this.config.appenders.length; i++) {
        this.config.appenders[i].layout = {
          type: 'basic'
        }
      }
    }
    log4js.configure(this.config);
    this.__logger = log4js.getLogger();
    this.__logger.setLevel(this.config.level.toUpperCase());
    global['log'] = this.__logger;
  } else {  // In case we just called crux.Log(), we just want to return an instance of log4js
    this.__logger = log4js.getLogger(_type || 'default');
    if (typeof _level === 'string') {
      this.__logger.setLevel(_level);
    }
    return this.__logger;
  }
}
654320
function level(lvl) {
  if(!lvl) return this._level;
  if(!~LEVELS.indexOf(lvl)) {
    throw new Error('invalid log level: ' + lvl);
  }
  this._level = lvl;
  return this._level;
}
930887
function (loggerName, level, message) {
    this.time = new Date();
    this.loggerName = loggerName;
    this.level = level;
    this.message = message;
  }