Using the API

Using the API is extremely simple, here's how:

Step 1

Add in a soft depend to DebugReport in your plugin.yml

Step 2

Get the DebugReport API:

if(Bukkit.getPluginManager().isPluginEnabled("DebugReport")) {
    DebugReport dreport = DebugReport.getInstance();
    //TODO: Get custom data from your plugin and call the report maker
}

Step 3

Call the proper API method: Use the following to create a default report, passing the user who requested it

public void createReport(CommandSender sender)


Use the following to create a report, passing the user who requested it with a list of lines of custom data

public void createReport(CommandSender sender, List<String> customdata)


Use the following to create a report, passing the user who requested it with your plugin name and the location of your plugin's log file. (When passed the report will include the last 60 lines from the log file)

public void createReport(CommandSender sender, String pluginname, File loglocation)


\ Use the following to create a report, passing the user who requested it with your plugin name and the location of your plugin's log file. (When passed the report will include the last 60 lines from the log file). The replacements parameter takes a list of StringReplacers, which has a list of regex with replacements to replace anything sensitive that shouldn't be in the report (like passwords)

public void createReport(CommandSender sender, String pluginname, File loglocation, List<StringReplacers> replacements)


Use the following to create a report, passing the user who requested it with a list of lines of custom data with your plugin name and the location of your plugin's log file. (When passed the report will include the last 60 lines from the log file).

public void createReport(CommandSender sender, List<String> customdata, String pluginname, File loglocation)


Use the following to create a report, passing the user who requested it with a list of lines of custom data with your plugin name and the location of your plugin's log file. (When passed the report will include the last 60 lines from the log file). The replacements parameter takes a list of StringReplacers, which has a list of regex with replacements to replace anything sensitive that shouldn't be in the report (like passwords)

public void createReport(CommandSender sender, List<String> customdata, String pluginname, File loglocation, List<StringReplacers> replacements)