打印日志

@param logLevel 日志级别
@param clazz 指定类
@param message 消息
@param values 格式化参数

@since 1.0.9
496518
public static void log(LogLevel logLevel, Class<?> clazz, String message, String... values) {
        switch (logLevel) {
            case WARN:
                warn(clazz, message, values);
                break;
            case ERROR:
                error(clazz, message, values);
                break;
            case FATAL:
                fatal(clazz, message, values);
                break;
            default:
                info(clazz, message, values);
                break;
        }
    }
783374
public function log($logLevel, $message, $tags = array())
    {
        if ($this->getLogger() instanceof \Psr\Log\LoggerInterface) {
            $this->getLogger()->log(
                common_log_Logger2Psr::getPsrLevelFromCommon($logLevel),
                $message
            );
        }
        if (method_exists('common_Logger', $logLevel)) {
            call_user_func('common_Logger::' . $logLevel, $message, $tags);
        }
    }
771783
public void log(int logLevel, String msg, Throwable tr) {
    println(logLevel, msg, tr);
  }
107718
public static function log($msg, $logLevel = X_LOG_DEBUG) {
        /** @var Logger $logger */
        $logger = ComponentFactory::getComponent('logger');
        $logger->log($msg, $logLevel, 2);
    }
1152185
@Override
    protected void log(final String msg) {
        if (config.getLogLevel().equals(LogLevel.DEBUG)) {
            logger.debug(msg);
        } else if (config.getLogLevel().equals(LogLevel.TRACE)) {
            logger.trace(msg);
        } else if (config.getLogLevel().equals(LogLevel.INFO)) {
            logger.info(msg);
        } else if (config.getLogLevel().equals(LogLevel.WARN)) {
            logger.warn(msg);
        } else if (config.getLogLevel().equals(LogLevel.ERROR)) {
            logger.error(msg);
        }
    }
1325047
public void log(String message, Level level) {
    log(null, null, message, level);
  }
1314705
public void error(String message, Object... args) {
		if (!NONE.equals(this.logLevel)) {
			System.out.println(String.format(message, args));
		}
	}
507036
public void log(final Level level, final String msg, final Object... args) {
        String message = msg;

        if (null != args && 0 < args.length) {
            // Is it a java.text style format?
            // Ideally we could match with Pattern.compile("\\{\\d").matcher(format).find())
            // However the cost is 14% higher, so we cheaply check for 1 of the first 4 parameters
            if (msg.indexOf("{0") >= 0 || msg.indexOf("{1") >= 0 || msg.indexOf("{2") >= 0 || msg.indexOf("{3") >= 0) {
                message = java.text.MessageFormat.format(msg, args);
            }
        }

        switch (level) {
            case ERROR:
                if (proxy.isErrorEnabled()) {
                    if (proxy instanceof LocationAwareLogger) {
                        ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.ERROR_INT, message, null, null);
                    } else {
                        proxy.error(message);
                    }
                }

                break;
            case WARN:
                if (proxy.isWarnEnabled()) {
                    if (proxy instanceof LocationAwareLogger) {
                        ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.WARN_INT, message, null, null);
                    } else {
                        proxy.warn(message);
                    }
                }

                break;
            case INFO:
                if (proxy.isInfoEnabled()) {
                    if (proxy instanceof LocationAwareLogger) {
                        ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.INFO_INT, message, null, null);
                    } else {
                        proxy.info(message);
                    }
                }

                break;
            case DEBUG:
                if (proxy.isDebugEnabled()) {
                    if (proxy instanceof LocationAwareLogger) {
                        ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.DEBUG_INT, message, null, null);
                    } else {
                        proxy.debug(message);
                    }
                }

                break;
            case TRACE:
                if (proxy.isTraceEnabled()) {
                    if (proxy instanceof LocationAwareLogger) {
                        ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.TRACE_INT, message, null, null);
                    } else {
                        proxy.trace(message);
                    }
                }

                break;
            default:
                throw new IllegalStateException("Logging level [" + level + "] is invalid");
        }
    }
763416
public static void log(int logLevel, String format, Object... args) {
    assertInitialization();
    sLogger.log(logLevel, format, args);
  }
618465
public void log(Level level, Object message) {
        doLog(level, FQCN, message, null, null);
    }
1190793
public static void debug(Class<?> clazz, String message, String... values) {
        getLogger(clazz).debug(formatString(message, values));
    }
1003224
public static void log(final String templateName, final Template template, final Values values) {
        new ValuesLogger().doLog(templateName, template, values);
    }
416912
public void log(Level level, String message, Object... args) {
      if (logger.isLoggable(level)) {
         String errorMessage = "";
         Throwable thrown = null;
         Object[] params = null;

         if (args == null || args.length == 0) {
            errorMessage = message;
         } else if (args[0] instanceof Throwable) {
            thrown = (Throwable) args[0];
            if (args.length > 1) {
               params = new Object[args.length - 1];
               System.arraycopy(args, 1, params, 0, args.length - 1);
            }
         } else if (args[args.length - 1] instanceof Throwable) {
            params = new Object[args.length - 1];
            System.arraycopy(args, 0, params, 0, args.length - 1);
            thrown = (Throwable) args[args.length - 1];
         } else {
            params = new Object[args.length];
            System.arraycopy(args, 0, params, 0, args.length);
         }

         if (params != null) {
            errorMessage = MessageFormat.format(message, params);
         }

         LogRecord record = new LogRecord(level, errorMessage);
         record.setLoggerName(logger.getName());
         record.setThrown(thrown);
         record.setParameters(args);
         logger.log(record);
      }
   }
434154
@Override
  public void log(Level level, Object message, Throwable e) {
    org.apache.log4j.Level pLevel = org.apache.log4j.Level.DEBUG;

    switch (level == null ? Level.FATAL : level) {
    case TRACE:
      pLevel = org.apache.log4j.Level.TRACE;
      break;
    case DEBUG:
      pLevel = org.apache.log4j.Level.DEBUG;
      break;
    case INFO:
      pLevel = org.apache.log4j.Level.INFO;
      break;
    case WARN:
      pLevel = org.apache.log4j.Level.WARN;
      break;
    case ERROR:
      pLevel = org.apache.log4j.Level.ERROR;
      break;
    case FATAL:
      pLevel = org.apache.log4j.Level.FATAL;
      break;
    default:
      // I don't know what this is, so consider it fatal
      pLevel = org.apache.log4j.Level.FATAL;
      l4jLogger.log("net.spy.compat.log.AbstractLogger", pLevel, "Unhandled "
          + "log level:  " + level + " for the following message", null);
    }
    l4jLogger.log("net.spy.compat.log.AbstractLogger", pLevel, message, e);
  }
536967
public static void logThreads(final Logger logger, final Level level, final String prefix) {
    logThreads(logger, level, prefix, "\n\t", "\n\t\t");
  }
1358313
public static void info(Class<?> clazz, String message, String... values) {
        getLogger(clazz).info(formatString(message, values));
    }
694764
public void log(Level level, String loggerFqcn, Object message, Throwable t) {
        doLog(level, loggerFqcn, message, null, t);
    }