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
-
Method Summary
Modifier and TypeMethodDescriptionstatic final void
Prints a message with arguments toSystem.err
.static final String
Formats a message with arguments.static final void
Prints 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
Json5
marshaller.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 theJson5
marshaller.
-
err
Prints a message with arguments toSystem.err
.Arguments are automatically converted to strings using the
Json5
marshaller.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 theJson5
marshaller.
-
format
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
- TheMessageFormat
-styled message.args
- The arguments sent to the the formatter after running them through theJson5
marshaller.- Returns:
- This object.
-