Removed unnecessary debug methods

This commit is contained in:
Eric 2017-03-29 20:02:41 +02:00
parent 928c0ef817
commit 0a67cd81a2

View File

@ -294,17 +294,17 @@ public class ShopChest extends JavaPlugin {
@Override
public void onDisable() {
debug("Disabling ShopChest...", true);
debug("Disabling ShopChest...");
if (updater != null) {
debug("Stopping updater", true);
debug("Stopping updater");
updater.cancel();
}
if (database != null) {
for (Shop shop : shopUtils.getShops()) {
shopUtils.removeShop(shop, false, true);
debug("Removed shop (#" + shop.getID() + ")", true);
debug("Removed shop (#" + shop.getID() + ")");
}
database.disconnect();
@ -320,26 +320,6 @@ public class ShopChest extends JavaPlugin {
}
}
/**
* Print a message to the <i>/plugins/ShopChest/debug.txt</i> file
* @param message Message to print
* @param useCurrentThread Whether the current thread should be used. If set to false, a new synchronized task will be created.
*/
public void debug(final String message, boolean useCurrentThread) {
if (config.enable_debug_log && fw != null) {
if (useCurrentThread) {
debug(message);
} else {
new BukkitRunnable() {
@Override
public void run() {
debug(message);
}
}.runTask(this);
}
}
}
/**
* Print a message to the <i>/plugins/ShopChest/debug.txt</i> file
* @param message Message to print
@ -358,28 +338,6 @@ public class ShopChest extends JavaPlugin {
}
}
/**
* Print a {@link Throwable}'s stacktrace to the <i>/plugins/ShopChest/debug.txt</i> file
* @param throwable {@link Throwable} whose stacktrace will be printed
* @param useCurrentThread Whether the current thread should be used. If set to false, a new synchronized task will be created.
*/
public void debug(final Throwable throwable, boolean useCurrentThread) {
if (config.enable_debug_log && fw != null) {
if (useCurrentThread) {
debug(throwable);
} else {
new BukkitRunnable() {
@Override
public void run() {
PrintWriter pw = new PrintWriter(fw);
throwable.printStackTrace(pw);
pw.flush();
}
}.runTask(this);
}
}
}
/**
* Print a {@link Throwable}'s stacktrace to the <i>/plugins/ShopChest/debug.txt</i> file
* @param throwable {@link Throwable} whose stacktrace will be printed