Package org.apache.juneau.utils
Class Console
java.lang.Object
org.apache.juneau.utils.Console
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidPrints a message with arguments toSystem.err.static final StringFormats a message with arguments.static final voidPrints a message with arguments toSystem.out.
-
Constructor Details
-
Console
public Console()
-
-
Method Details
-
out
Prints a message with arguments toSystem.out.Arguments are automatically converted to strings using the
Json5marshaller.Useful for debug messages.
Example:
Console.
out ("myPojo={0}" ,myPojo );- Parameters:
msg- TheMessageFormat-styled message.args- The arguments sent to the the formatter after running them through theJson5marshaller.
-
err
Prints a message with arguments toSystem.err.Arguments are automatically converted to strings using the
Json5marshaller.Useful for debug messages.
Example:
Console.
err ("myPojo={0}" ,myPojo );- Parameters:
msg- TheMessageFormat-styled message.args- The arguments sent to the the formatter after running them through theJson5marshaller.
-
format
Formats a message with arguments.Arguments are automatically converted to strings using the
Json5marshaller.Useful for debug messages.
Example:
String
msg = Console.format ("myPojo={0}" ,myPojo );- Parameters:
msg- TheMessageFormat-styled message.args- The arguments sent to the the formatter after running them through theJson5marshaller.- Returns:
- This object.
-