Class Console

java.lang.Object
org.apache.juneau.utils.Console

public class Console extends Object
A utility for logging formatted messages to the console. Uses the Json5 marshaller for serializing objects so any POJOs can be used as format arguments.
  • Constructor Details

  • Method Details

    • out

      public static final void out(String msg, Object... args)
      Prints a message with arguments to System.out.

      Arguments are automatically converted to strings using the Json5 marshaller.

      Useful for debug messages.

      Example:

      Console.out("myPojo={0}", myPojo);

      Parameters:
      msg - The MessageFormat-styled message.
      args - The arguments sent to the the formatter after running them through the Json5 marshaller.
    • err

      public static final void err(String msg, Object... args)
      Prints a message with arguments to System.err.

      Arguments are automatically converted to strings using the Json5 marshaller.

      Useful for debug messages.

      Example:

      Console.err("myPojo={0}", myPojo);

      Parameters:
      msg - The MessageFormat-styled message.
      args - The arguments sent to the the formatter after running them through the Json5 marshaller.
    • format

      public static final String format(String msg, Object... args)
      Formats a message with arguments.

      Arguments are automatically converted to strings using the Json5 marshaller.

      Useful for debug messages.

      Example:

      String msg = Console.format("myPojo={0}", myPojo);

      Parameters:
      msg - The MessageFormat-styled message.
      args - The arguments sent to the the formatter after running them through the Json5 marshaller.
      Returns:
      This object.