纪录日志

@inner
@param {Object} requester 请求对象
@param {string} level 日志级别
499904
function log(requester, level) {
    var context = requester.context;
    var logger = context.data.logger;
    if (!logger || !logger[level]) {
        return;
    }

    var args = Array.prototype.slice.call(arguments, 2);
    args[0] = 'AJAX-' + requester.uid + ' ' + args[0];
    logger[level].apply(logger, args);
}
298136
public void logf(Level level, String format, Object param1) {
        if (isEnabled(level)) {
            doLogf(level, FQCN, format, new Object[] { param1 }, null);
        }
    }
1302025
public JULQueryCountLoggingHandlerInterceptor buildJULHandlerInterceptor(Level logLevel) {
        if (logLevel != null) {
            this.julLogLevel = logLevel;
        }

        JULQueryCountLoggingHandlerInterceptor handlerInterceptor = new JULQueryCountLoggingHandlerInterceptor();
        if (this.julLogLevel != null) {
            handlerInterceptor.setLogLevel(this.julLogLevel);
        }
        handlerInterceptor.setWriteAsJson(this.writeAsJson);
        return handlerInterceptor;
    }
413484
function Requester() {
		// setup abstract layer
		core.RequesterAbstract.apply(this, arguments);

		// in case the process die, the connection will be severed
		this.object.on('exit', function () {
			if (self.online === true) {
				this.emit('close');
			}
		});

		// just relay message object they do not need to be parsed
		this.object.on('message', this.emit.bind(this, 'message'));

		// when the remote request a method, the methods should exists in .handlers
		var self = this;
		this.handlers.close = function () {
			this.callback();
			self.emit('close');
		};
	}
738697
function writeToLog(level, msg)
    {
        var displayPrefix = "PK-" + pkGuid + ": ";
        if(loggingMechanism && logUserObject)
        {
            loggingMechanism.addLog(level, displayPrefix + msg, logUserObject);
        }
        else
        {
            console.log(displayPrefix + msg);
        }
    }
325491
public static void loggerInit(Level level, boolean isRedirectStdOutErr, String format)
      throws IOException {
    // Set the java util logging format
    setLoggingFormat(format);

    // Configure the root logger and its handlers so that all the
    // derived loggers will inherit the properties
    Logger rootLogger = Logger.getLogger("");
    for (Handler handler : rootLogger.getHandlers()) {
      handler.setLevel(level);
    }

    rootLogger.setLevel(level);

    if (rootLogger.getLevel().intValue() < Level.WARNING.intValue()) {
      // zookeeper logging scares me. if people want this, we can patch to config-drive this
      Logger.getLogger("org.apache.zookeeper").setLevel(Level.WARNING);
    }

    // setting logging for http client to be error level
    System.setProperty(
        "org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
    System.setProperty(
        "org.apache.commons.logging.simplelog.log.httpclient.wire", "ERROR");
    System.setProperty(
        "org.apache.commons.logging.simplelog.log.org.apache.http", "ERROR");
    System.setProperty(
        "org.apache.commons.logging.simplelog.log.org.apache.http.headers", "ERROR");

    if (isRedirectStdOutErr) {

      // Remove ConsoleHandler if present, to avoid StackOverflowError.
      // ConsoleHandler writes to System.err and since we are redirecting
      // System.err to Logger, it results in an infinite loop.
      for (Handler handler : rootLogger.getHandlers()) {
        if (handler instanceof ConsoleHandler) {
          rootLogger.removeHandler(handler);
        }
      }

      // now rebind stdout/stderr to logger
      Logger logger;
      LoggingOutputStream los;

      logger = Logger.getLogger("stdout");
      los = new LoggingOutputStream(logger, StdOutErrLevel.STDOUT);
      System.setOut(new PrintStream(los, true));

      logger = Logger.getLogger("stderr");
      los = new LoggingOutputStream(logger, StdOutErrLevel.STDERR);
      System.setErr(new PrintStream(los, true));
    }
  }
907109
public function showByLevel($date, $level, Request $request)
    {
        if ($level === 'all')
            return redirect()->route($this->showRoute, [$date]);

        $log     = $this->getLogOrFail($date);
        $query   = $request->get('query');
        $levels  = $this->logViewer->levelsNames();
        $entries = $this->logViewer->entries($date, $level)->paginate($this->perPage);

        return $this->view('show', compact('level', 'log', 'query', 'levels', 'entries'));
    }
4730
private void log(String callerFQCN, Level level, String msg, Throwable t) {
        // millis and thread are filled by the constructor
        LogRecord record = new LogRecord(level, msg);
        record.setLoggerName(getName());
        record.setThrown(t);
        // Note: parameters in record are not set because SLF4J only
        // supports a single formatting style
        fillCallerData(callerFQCN, record);
        loggerImpl.log(record);
    }
1223750
public ProxyDataSourceBuilder logQueryByJUL(Level logLevel, String julLoggerName) {
        this.createJulQueryListener = true;
        this.julLogLevel = logLevel;
        this.julLoggerName = julLoggerName;
        return this;
    }
250689
function log(message, level) {
    var prefix = "[" + colors.cyan("gulp-tslint") + "]";
    if (level === "error") {
        fancyLog(prefix, colors.red("error"), message);
    }
    else {
        fancyLog(prefix, message);
    }
}
1198280
function requestHandler(req, res, next) {
  const start = Date.now();
  let source;

  return Promise.try(() => {
    source = core.getPublicSource(req.params.src);
    return source.getHandler().getInfoAsync().then(info => [info, infoHeaders]);
  }).spread((data, dataHeaders) => {
    core.setResponseHeaders(res, source, dataHeaders);

    if (req.query && req.query.format) {
      const escapedText = JSON.stringify(data, null, ' ').replace(/&/g, '&amp;').replace(/</g, '&lt;');
      res.send(`<pre>${escapedText}</pre>`);
    } else {
      res.json(data);
    }

    const mx = util.format('req.%s.info', req.params.src);
    core.metrics.endTiming(mx, start);
  }).catch(err => core.reportRequestError(err, res)).catch(next);
}
630683
public void logv(Level level, String format, Object... params) {
        doLog(level, FQCN, format, params, null);
    }
1209620
public static void addDeepLogger(Object object, Level level)
    {
        addDeepLogger(object, m -> logger.log(level, m));
    }
1046871
function log(logLevel, level, content) {
	var output = true;

	switch (logLevel) {
	case 'slient':
		if (level !== 'lv1') {
			output = false;
		}
		break;
	case 'info':
		if (level === 'lv3') {
			output = false;
		}
		break;
	default:
		output = true;
	}
	if (output) {
		var data = Array.prototype.slice.call(content);
		fancyLog.apply(false, data);
	}
}
1075833
private HttpLoggingInterceptor loggingInterceptor(int logLevel) {

        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();

        switch (logLevel) {
            case LogLevelConst.DEBUG:
                interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
                break;
            default:
                interceptor.setLevel(HttpLoggingInterceptor.Level.NONE);
                break;
        }

        return interceptor;
    }
1161952
function(logLevel, message, exception) {
		var loggingEvent = new Log4js.LoggingEvent(this.category, logLevel, 
			message, exception, this);
		this.loggingEvents.push(loggingEvent);
		this.onlog.dispatch(loggingEvent);
	}
145068
public static void logLevel(String level) {
        if (!Arrays.asList("TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF").contains(level)) {
            throw new IllegalArgumentException("log level \"" + level + "\" is not legal it must be one of \"TRACE\", \"DEBUG\", \"INFO\", \"WARN\", \"ERROR\", \"OFF\"");
        }
        System.setProperty(MOCKSERVER_LOG_LEVEL, level);
        MockServerLogger.initialiseLogLevels();
    }