记录结束时间并当处理时间超过预定的阈值时发出警告信息，最后清除
@param logger
@param key
@param threshold 阈值（单位：ms）
515839
public static void endWithSlowLog(Logger logger, String key, long threshold) {
		slowLog(logger, key, end(key), threshold);
	}
134513
public void logp(Level level, String sourceClass, String sourceMethod,
		String msg, Object params[]) 
	{
			//PK86423 Start
			//int lastParam = params.length-1;
			//if(params.length>0 && params[lastParam] instanceof Throwable){
			//	params[lastParam]=throwableToString((Throwable) params[lastParam]);
			//}
			if(params!=null && params.length>0 && params[params.length-1] instanceof Throwable){
				params[params.length-1]=throwableToString((Throwable) params[params.length-1]);
			}
			//PK86423 End
			delegateLogger.logp(level,sourceClass,sourceMethod,msg,params);
	}
1063309
public void setThreshold(final double THRESHOLD) {
        originalThreshold = THRESHOLD;
        if (null == threshold) {
            _threshold = Helper.clamp(getMinValue(), getMaxValue(), THRESHOLD);
            fireUpdateEvent(RESIZE_EVENT);
        } else {
            threshold.set(THRESHOLD);
        }
    }
925082
@Override
    public synchronized void remove(String key) {
        boolean deleted = getFileForKey(key).delete();
        removeEntry(key);
        if (!deleted) {
            //todo add queue markers
//            JusLog.d("Could not delete cache entry for key=%s, filename=%s",
//                    key, getFilenameForKey(key));
        }
    }
599957
public void setLoggerLevel(String level) {
        if ("TRACE".equalsIgnoreCase(level)) {
            this.level = TRACE;
        } else if ("DEBUG".equalsIgnoreCase(level)) {
            this.level = DEBUG;
        } else if ("INFO".equalsIgnoreCase(level)) {
            this.level = INFO;
        } else if ("WARN".equalsIgnoreCase(level)) {
            this.level = WARN;
        } else if ("ERROR".equalsIgnoreCase(level)) {
            this.level = ERROR;
        }
    }
434635
public static SplitThresholdLogTemplate whenSplitLongerThanMilliseconds(LogTemplate<Split> delegateLogger, long threshold) {
		return whenSplitLongerThanNanoseconds(delegateLogger, threshold * SimonClock.NANOS_IN_MILLIS);
	}
298136
public void logf(Level level, String format, Object param1) {
        if (isEnabled(level)) {
            doLogf(level, FQCN, format, new Object[] { param1 }, null);
        }
    }
124601
public static void setLogging(boolean logging) {
        if (logging) {
            logger.setLevel(debugging ? Level.FINE : Level.INFO);
        } else {
            logger.setLevel(Level.OFF);
        }
    }
206914
private void removeEntriesStartingWith(String key) {
        synchronized (eventMap) {
            Iterator<String> iter = eventMap.keySet().iterator();
            while (iter.hasNext()) {
                String str = iter.next();
                if (str.startsWith(key)) {
                    iter.remove();
                }
            }
        }
    }
925120
public void closeLogger(String loggerName) {
        if (this.openLoggers.containsKey(loggerName)) {
            try {
                this.openLoggers.get(loggerName).close();
            } catch (Exception e) {
                throw new DelegatedRuntimeException(e);
            }
            this.openLoggers.remove(loggerName);
        }
    }
1312392
public static synchronized void removeLogger(@NonNull JobLogger logger) {
        for (int i = 0; i < loggers.length; i++) {
            if (logger.equals(loggers[i])) {
                loggers[i] = null;
                // continue, maybe for some reason the logger is twice in the array
            }
        }
    }
632492
public void delete(int key) {
        int i = ContainerHelpers.binarySearch(mKeys, mSize, key);

        if (i >= 0) {
            System.arraycopy(mKeys, i + 1, mKeys, i, mSize - (i + 1));
            System.arraycopy(mValues, i + 1, mValues, i, mSize - (i + 1));
            mSize--;
        }
    }
901049
public static void slowLog(Logger logger, String key, long duration, long threshold, String context) {
		if (duration > threshold) {
			logger.warn("[Performance Warning] task {} use {}ms, slow than {}ms, contxt={}", key, duration, threshold,
					context);
		}
	}
1325047
public void log(String message, Level level) {
    log(null, null, message, level);
  }
1344523
public ProxyDataSourceBuilder logSlowQueryBySlf4j(long thresholdTime, TimeUnit timeUnit, SLF4JLogLevel logLevel, String loggerName) {
        this.createSlf4jSlowQueryListener = true;
        this.slowQueryThreshold = thresholdTime;
        this.slowQueryTimeUnit = timeUnit;
        this.slf4jSlowQueryLogLevel = logLevel;
        this.slf4jSlowQueryLoggerName = loggerName;
        return this;
    }
954581
public static void setLogStdErr(boolean log)
    {
        if (log)
        {
            if (!(System.err instanceof LogStream))
                System.setErr(new LogStream.STDERR());
        }
        else
            System.setErr(STDERR_STREAM);
    }
832619
static public void setLogLevel(LogLevel level) {
        logLevel = level;
        log.setLevel(level.value());
        for (Handler handler : log.getHandlers()) {
            handler.setLevel(level.value());
        }
    }