-
Couldn't load subscription status.
- Fork 53
Output
Faizaan edited this page Dec 29, 2016
·
4 revisions
Sometimes it's useful to log output to the server console. This is very easy to do for a Prison module. This is done by using the Output utility.
You can retrieve an instance of the Output class using Output.get(). Here is a demo.
Output.get().logInfo("This is a test message. This also does %s for you.", "String.format");
// For warn and error, you can put as many Exceptions as you want (or none at all), and they will be printed neatly.
Output.get().logWarn("This is a warning message with different colors.", new Exception("Why not?"));
Output.get().logError("This is an error message with different colors.", new Exception("The iguanas have escaped the zoo."));Note: You may use Minecraft color codes in your messages, prefixed by an ampersand. Examples: &a, &b, &c, etc.
The output looks like this:
You may also use sendInfo(), sendWarn(), and sendError() to send error messages to CommandSenders. See the javadocs for more details.

