Write a message to the console.

@param pattern
A {@link String#format(String, Object...)} pattern
@param parameters
Optional parameters to plug into the pattern
964069
public void writeLine(String pattern, Object... parameters) {
        String line = (parameters == null || parameters.length == 0) ? pattern
                : String.format(pattern, parameters);
        lines.add(0, line); // we'll write bottom to top, then purge unwritten
        // lines from end
        updateHUD();
    }
735907
public static void log(Logger logger,
                           Level level,
                           String message,
                           Object[] parameters) {
        if (logger.isLoggable(level)) {
            String msg = localize(logger, message);
            try {
                msg = MessageFormat.format(msg, parameters);
            } catch (IllegalArgumentException ex) {
                //ignore, log as is
            }
            doLog(logger, level, msg, null);
        }
    }
198494
function println(format, varArgs) {
  var vargs = Array.from(arguments);
  vargs[0] += '\n';
  process.stdout.write(sprintf.apply(null, vargs));
}
1280621
public static CharSequence matchesPattern(final CharSequence input, final String pattern, final String message) {
        return INSTANCE.matchesPattern(input, pattern, message);
    }
50027
public static String format(String pattern, Object... arguments) {
        String msg = pattern;
        if (arguments != null) {
            for (int index = 0; index < arguments.length; index++) {
                msg = msg.replaceAll("\\{" + (index + 1) + "\\}", String.valueOf(arguments[index]));
            }
        }
        return msg;
    }
575453
private static void display(String format, Object... args) {
        System.out.println(MessageFormatter.arrayFormat(format, args).getMessage());
    }
388656
@Override
    public void trace(String format, Object arg) {
        if (isTraceEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.log(FQCN, traceCapable ? Level.TRACE : Level.DEBUG, ft
                    .getMessage(), ft.getThrowable());
        }
    }
52610
public void format(MessageArgs args, StringBuilder buf) {
    this.args = args;
    this.buf = buf;
    this.reset();
    format(streams[0], null);
  }
938981
public static void i(String tag, String pattern, Object... parameters) {
        i(SUBSYSTEM.MAIN, tag, pattern, parameters);
    }
774655
private void format(Object[] arguments, Map<String, Object> argsMap,
                        AppendableWrapper dest, FieldPosition fp) {
        if (arguments != null && msgPattern.hasNamedArguments()) {
            throw new IllegalArgumentException(
                "This method is not available in MessageFormat objects " +
                "that use alphanumeric argument names.");
        }
        format(0, null, arguments, argsMap, dest, fp);
    }
1106695
public static String format(final long millis, final String pattern) {
        return format(new Date(millis), pattern, null, null);
    }
565434
public void writeRegex(Pattern pattern) throws IOException {
		_writeArrayFieldNameIfNeeded();
		_verifyValueWrite("write regex");
		_buffer.putByte(_typeMarker, BsonConstants.TYPE_REGEX);
		_writeCString(pattern.pattern());
		_writeCString(flagsToRegexOptions(pattern.flags()));
		flushBuffer();
	}
1232693
private void parsePattern(String pattern){

		int currentIndex = 0;
		int patternLength = pattern.length();
		Vector<FormatCommandInterface> converterVector = new Vector<FormatCommandInterface>(20);

		while (currentIndex < patternLength) {
			char currentChar = pattern.charAt(currentIndex);

			if (currentChar == '%') {

				currentIndex++;
				currentChar = pattern.charAt(currentIndex);

				switch (currentChar) {
					case CLIENT_ID_CONVERSION_CHAR:
						converterVector.addElement(new ClientIdFormatCommand());
						break;
					case CATEGORY_CONVERSION_CHAR:
						CategoryFormatCommand categoryFormatCommand = new CategoryFormatCommand();
						String specifier = extraxtSpecifier(pattern, currentIndex);
						int specifierLength = specifier.length();
						if (specifierLength > 0) {
							categoryFormatCommand.init(specifier);
							currentIndex = currentIndex + specifierLength + 2;
						}
						converterVector.addElement(categoryFormatCommand);
						break;
					case DATE_CONVERSION_CHAR:
						DateFormatCommand formatCommand = new DateFormatCommand();
						specifier = extraxtSpecifier(pattern, currentIndex);
						specifierLength = specifier.length();
						if (specifierLength > 0) {
							formatCommand.init(specifier);
							currentIndex = currentIndex + specifierLength + 2;
						}
						converterVector.addElement(formatCommand);
						break;
					case MESSAGE_CONVERSION_CHAR:
						converterVector.addElement(new MessageFormatCommand());
						break;

					case PRIORITY_CONVERSION_CHAR:
						converterVector.addElement(new PriorityFormatCommand());
						break;

					case RELATIVE_TIME_CONVERSION_CHAR:
						converterVector.addElement(new TimeFormatCommand());
						break;

					case THREAD_CONVERSION_CHAR:
						converterVector.addElement(new ThreadFormatCommand());
						break;

					case THROWABLE_CONVERSION_CHAR:
						converterVector.addElement(new ThrowableFormatCommand());
						break;

					case PERCENT_CONVERSION_CHAR:
						NoFormatCommand noFormatCommand = new NoFormatCommand();
						noFormatCommand.init("%");
						converterVector.addElement(noFormatCommand);
						break;

					default:
						Log.e(TAG, "Unrecognized conversion character " + currentChar);
						break;
				}

				currentIndex++;

			} else {

				int percentIndex = pattern.indexOf("%", currentIndex);
				String noFormatString = "";
				if (percentIndex != -1) {
					noFormatString = pattern.substring(currentIndex, percentIndex);
				} else {
					noFormatString = pattern.substring(currentIndex, patternLength);
				}

				NoFormatCommand noFormatCommand = new NoFormatCommand();
				noFormatCommand.init(noFormatString);
				converterVector.addElement(noFormatCommand);

				currentIndex = currentIndex + noFormatString.length();
			}

		}

		commandArray = new FormatCommandInterface[converterVector.size()];
		converterVector.copyInto(commandArray);

		patternParsed = true;
	}
734980
public static IllegalArgumentException IllegalArgument(String pattern,
            Object... parameters) {
        return strip(new IllegalArgumentException(String.format(pattern,
                parameters)));
    }
150665
private void addPattern(MethodSpec.Builder method, String pattern) {
    // Parse the pattern and populate the method body with instructions to format the date.
    for (Node node : DATETIME_PARSER.parse(pattern)) {
      if (node instanceof Text) {
        method.addStatement("b.append($S)", ((Text)node).text());
      } else if (node instanceof Field) {
        Field field = (Field)node;
        method.addStatement("formatField(d, '$L', $L, b)", field.ch(), field.width());
      }
    }
  }
1346393
String format(String pattern) {
        return String.format(pattern, this.domain, this.major, this.minor);
    }
1297692
public void debug( String format, Object arg )
    {
        if( m_delegate.isDebugEnabled() )
        {
            FormattingTuple tuple = MessageFormatter.format( format, arg );
            m_delegate.debug( tuple.getMessage(), tuple.getThrowable() );
        }
    }