Logs the specified message with the specified logging level and arguments.

@param level the specified logging level
@param msg   the specified message
@param args  the specified arguments
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");
        }
    }
1177373
private void formatAndLog(int level, String format, Object arg1, Object arg2) {
        if (!isLevelEnabled(level)) {
            return;
        }
        FormattingTuple tp = MessageFormatter.format(format, arg1, arg2);
        log(level, tp.getMessage(), tp.getThrowable());
    }
1143348
public synchronized void log (String message, Object...args)
    {
        // construct the message
        message = Logger.format(message, args);
        StringBuffer buf = new StringBuffer(message.length() + TIMESTAMP_LENGTH);
        _format.format(new Date(), buf, _fpos);
        buf.append(message);

        // and write it to the log
        boolean wrote = false;
        if (_logWriter != null) {
            _logWriter.println(buf.toString());
            wrote = !_logWriter.checkError();
        }

        // log an error if we failed to write the log message
        if (!wrote) {
            // be careful about logging zillions of errors if something bad happens to our log file
            if (_throttle.throttleOp()) {
                _throttled++;
            } else {
                if (_throttled > 0) {
                    log.warning("Suppressed " + _throttled + " intervening error messages.");
                    _throttled = 0;
                }
                log.warning("Failed to write audit log message", "file", _logPath, "msg", message);
            }
        }
    }
518523
public void debug(final String message, final int level) {
        messages.add(new LogMessage(message, LogMessage.Type.DEBUG, level));
        log.debug(message);
    }
812818
public static void i(String tag, String msg, Object... args) {
        if (sLevel > LEVEL_INFO) {
            return;
        }
        if (args.length > 0) {
            msg = String.format(msg, args);
        }
        Log.i(tag, msg);
    }
905905
public static void info(String msg, Object... args) {
		String tag = generateTag();
		if (!"".equals(tag)) {
			if (args.length > 0) {
				Log.i(tag, String.format(msg, args));
			} else {
				Log.i(tag, msg);

			}
		}
	}
1079130
public void log(String message, Map<String, Object> custom, Level level) {
    log(null, custom, message, level);
  }
763416
public static void log(int logLevel, String format, Object... args) {
    assertInitialization();
    sLogger.log(logLevel, format, args);
  }
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);
      }
   }
881189
public static void d(String tag, String msg, Object... args) {
        if (sLevel > LEVEL_DEBUG) {
            return;
        }
        if (args.length > 0) {
            msg = String.format(msg, args);
        }
        Log.d(tag, msg);
    }
707191
protected void log(LogLevel level,Object[] message,Throwable throwable)
    {
        if(level.getValue()>=this.logLevel.getValue())
        {
            //log the message
            this.logImpl(level,message,throwable);
        }
    }
65868
public static void print(ConsoleLevel level, String message) {
		if (level.compareTo(_level) <= 0) {
			if (_printLogLevel) {
				level.getStream().println(level.name() + ": " + message);
			}
			else {
				level.getStream().println(message);
			}
			level.getStream().flush();
		}
	}
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);
    }
602334
public static void v(String tag, String msg, Object... args) {
        if (sLevel > LEVEL_VERBOSE) {
            return;
        }
        if (args.length > 0) {
            msg = String.format(msg, args);
        }
        Log.v(tag, msg);
    }
1226094
public void log(final Level level, final String msg, final Throwable throwable) {
        switch (level) {
            case ERROR:
                if (proxy.isErrorEnabled()) {
                    if (proxy instanceof LocationAwareLogger) {
                        ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.ERROR_INT, msg, null, throwable);
                    } else {
                        proxy.error(msg, throwable);
                    }
                }

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

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

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

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

                break;
            default:
                throw new IllegalStateException("Logging level [" + level + "] is invalid");
        }
    }
1142664
public static void log(int logLevel, String msg, Throwable tr) {
    assertInitialization();
    sLogger.log(logLevel, msg, tr);
  }
48620
private static function log(string $level, string $message, array $context = [])
    {
        if (static::$logger !== null) {
            static::$logger->$level($message, $context);
        }
    }