CustomLogAPI
Usin this API will allow you to Create your own custom log files and write to them using the generic logger statements.
Current Features:
- Create '.log' files
- Takes any string as an input
- Optional GUI
The GUI allows other plugins to display a visual update of what is being entered into the log file.
How To Use The API:
1) Add the API file you your build path
2) I plugin.yml, make a dependency (can be soft-depend) for "CustomLogAPI"
depend: [CustomLogAPI]
3) Call the constructor in your plugin:
CustomLogAPI api = new CustomLogAPI(plugin, filename, boolean);
plugin = instance of your main plugin file
filename = the name of the log file you want (do not include the extension as the API automatically uses '.log')
boolean = true/false to display the GUI screen (server side only)
4) Log messages: There is two ways to log a message:
- INFO
- WARNING
The format of the message in the log file follows the same format as the craftbukkit logger. Heres how to add the messages:
api.Info("Info Message"); api.Warning("Warning Message");
5) Close the GUI: If you use the GUI this is a MUST!!! This should be placed in your "onDisable()" function to make sure that when the server restarts/closes the windows close. Otherwise you will get multiple instances of the logger.
api.closeLogDisplay();
This is recommended BUT depending on your plugin it may not be needed.
If you do not follow these instructions, I will not take responsibility if this breaks your plugin/server.
Comments