mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 17:15:07 +02:00
More logging!
This commit is contained in:
@@ -159,8 +159,7 @@ public class ManagedFile
|
||||
else
|
||||
{
|
||||
Bukkit.getLogger().warning(
|
||||
"File " + file.toString() + " has been modified by user and file version "
|
||||
+ "differs, please update the file manually.");
|
||||
"File " + file.toString() + " has been modified by user and file version differs, please update the file manually.");
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
@@ -15,12 +15,12 @@ public class Essentials extends JavaPlugin
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
Bukkit.getLogger().info("You can remove this compatibility plugin, when all plugins are updated to Essentials-3");
|
||||
IPlugin plugin = (IPlugin)getServer().getPluginManager().getPlugin("Essentials-3");
|
||||
ess = plugin.getEssentials();
|
||||
ess.getLogger().info("You can remove this compatibility plugin, when all plugins are updated to Essentials-3");
|
||||
//TODO: Update files to new 3.0 format
|
||||
//TODO: Move Eco Api here
|
||||
//TODO: write update methods for itemmeta
|
||||
IPlugin plugin = (IPlugin)getServer().getPluginManager().getPlugin("Essentials-3");
|
||||
ess = plugin.getEssentials();
|
||||
updateSettings();
|
||||
updateUserfiles();
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
public final class Settings implements ISettings
|
||||
{
|
||||
private final EssentialsConf config;
|
||||
private final static Logger logger = Logger.getLogger("Minecraft");
|
||||
private final IEssentials ess;
|
||||
private boolean metricsEnabled = true;
|
||||
|
||||
@@ -418,7 +417,7 @@ public final class Settings implements ISettings
|
||||
final List<Integer> epItemSpwn = new ArrayList<Integer>();
|
||||
if (ess.getItemDb() == null)
|
||||
{
|
||||
logger.log(Level.FINE, "Aborting ItemSpawnBL read, itemDB not yet loaded.");
|
||||
ess.getLogger().log(Level.FINE, "Aborting ItemSpawnBL read, itemDB not yet loaded.");
|
||||
return epItemSpwn;
|
||||
}
|
||||
for (String itemName : config.getString("item-spawn-blacklist", "").split(","))
|
||||
@@ -435,7 +434,7 @@ public final class Settings implements ISettings
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, "item-spawn-blacklist"));
|
||||
ess.getLogger().log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, "item-spawn-blacklist"));
|
||||
}
|
||||
}
|
||||
return epItemSpwn;
|
||||
@@ -471,7 +470,7 @@ public final class Settings implements ISettings
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", signName, "enabledSigns"));
|
||||
ess.getLogger().log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", signName, "enabledSigns"));
|
||||
continue;
|
||||
}
|
||||
signsEnabled = true;
|
||||
@@ -565,7 +564,7 @@ public final class Settings implements ISettings
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, configName));
|
||||
ess.getLogger().log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, configName));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
@@ -12,7 +12,6 @@ import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class EssentialsConnect
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private final IEssentials ess;
|
||||
private final IAntiBuild antib;
|
||||
|
||||
@@ -20,7 +19,7 @@ public class EssentialsConnect
|
||||
{
|
||||
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
essPlugin.getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
}
|
||||
ess = ((BukkitPlugin)essPlugin).getEssentials();
|
||||
antib = (IAntiBuild)essProtect;
|
||||
@@ -43,7 +42,7 @@ public class EssentialsConnect
|
||||
final Location loc = user.getLocation();
|
||||
final String warnMessage = _(
|
||||
"alertFormat", user.getName(), type, item, loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ());
|
||||
LOGGER.log(Level.WARNING, warnMessage);
|
||||
ess.getLogger().log(Level.WARNING, warnMessage);
|
||||
for (Player p : ess.getServer().getOnlinePlayers())
|
||||
{
|
||||
if (Permissions.ALERTS.isAuthorized(p))
|
||||
|
@@ -18,7 +18,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class EssentialsChat extends JavaPlugin
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
@@ -28,7 +27,7 @@ public class EssentialsChat extends JavaPlugin
|
||||
final IEssentials ess = (IEssentials)plugin.getEssentials();
|
||||
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
}
|
||||
if (!plugin.isEnabled())
|
||||
{
|
||||
|
@@ -18,7 +18,6 @@ import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
public abstract class EssentialsChatPlayer implements Listener
|
||||
{
|
||||
protected IEssentials ess;
|
||||
protected final static Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
protected final Server server;
|
||||
protected final Map<AsyncPlayerChatEvent, ChatStore> chatStorage;
|
||||
|
||||
|
@@ -27,7 +27,6 @@ import org.bukkit.plugin.Plugin;
|
||||
public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
{
|
||||
private LookupService ls = null;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private File databaseFile;
|
||||
private final ConfigHolder config;
|
||||
private final IEssentials ess;
|
||||
@@ -127,7 +126,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("Can't find GeoIP database!"));
|
||||
ess.getLogger().log(Level.SEVERE, _("Can't find GeoIP database!"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -137,7 +136,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("Failed to read GeoIP database!"), ex);
|
||||
ess.getLogger().log(Level.SEVERE, _("Failed to read GeoIP database!"), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +144,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
{
|
||||
if (url == null || url.isEmpty())
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("GeoIP download url is empty."));
|
||||
ess.getLogger().log(Level.SEVERE, _("GeoIP download url is empty."));
|
||||
return;
|
||||
}
|
||||
if (!databaseFile.getAbsoluteFile().getParentFile().exists())
|
||||
@@ -156,7 +155,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
OutputStream output = null;
|
||||
try
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("Downloading GeoIP database... this might take a while (country: 0.6 MB, city: 20MB)"));
|
||||
ess.getLogger().log(Level.INFO, _("Downloading GeoIP database... this might take a while (country: 0.6 MB, city: 20MB)"));
|
||||
final URL downloadUrl = new URL(url);
|
||||
final URLConnection conn = downloadUrl.openConnection();
|
||||
conn.setConnectTimeout(10000);
|
||||
@@ -179,11 +178,11 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
}
|
||||
catch (MalformedURLException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("GeoIP download url is invalid."), ex);
|
||||
ess.getLogger().log(Level.SEVERE, _("GeoIP download url is invalid."), ex);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||
ess.getLogger().log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -195,7 +194,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||
ess.getLogger().log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||
}
|
||||
}
|
||||
if (input != null)
|
||||
@@ -206,7 +205,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||
ess.getLogger().log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,7 +10,6 @@ import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class EssentialsConnect
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private final IEssentials ess;
|
||||
private final IProtect protect;
|
||||
|
||||
@@ -18,7 +17,7 @@ public class EssentialsConnect
|
||||
{
|
||||
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
essPlugin.getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
}
|
||||
ess = ((BukkitPlugin)essPlugin).getEssentials();
|
||||
protect = (IProtect)essProtect;
|
||||
|
@@ -10,7 +10,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class EssentialsProtect extends JavaPlugin implements IProtect
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private EssentialsConnect ess = null;
|
||||
private ProtectHolder settings = null;
|
||||
|
||||
@@ -45,7 +44,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
||||
{
|
||||
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors."); //TODO: tl this
|
||||
}
|
||||
LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essentials Protect is in emergency mode now."); //TODO: tl this
|
||||
getLogger().log(Level.SEVERE, "Essentials not installed or failed to load. Essentials Protect is in emergency mode now."); //TODO: tl this
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -15,7 +15,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class EssentialsSignsPlugin extends JavaPlugin implements ISignsPlugin
|
||||
{
|
||||
private static final Logger LOGGER = Bukkit.getLogger();
|
||||
private SignsConfigHolder config;
|
||||
|
||||
@Override
|
||||
@@ -26,7 +25,7 @@ public class EssentialsSignsPlugin extends JavaPlugin implements ISignsPlugin
|
||||
final IEssentials ess = (IEssentials)plugin.getEssentials();
|
||||
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
}
|
||||
if (!plugin.isEnabled())
|
||||
{
|
||||
|
@@ -23,7 +23,6 @@ public class SignBlockListener implements Listener
|
||||
{
|
||||
private final IEssentials ess;
|
||||
private final ISignsPlugin plugin;
|
||||
private final static Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private final static int WALL_SIGN = Material.WALL_SIGN.getId();
|
||||
private final static int SIGN_POST = Material.SIGN_POST.getId();
|
||||
|
||||
@@ -52,7 +51,7 @@ public class SignBlockListener implements Listener
|
||||
// prevent any signs be broken by destroying the block they are attached to
|
||||
if (EssentialsSign.checkIfBlockBreaksSigns(block))
|
||||
{
|
||||
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
||||
ess.getLogger().log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,7 +72,7 @@ public class SignBlockListener implements Listener
|
||||
{
|
||||
if (sign.getBlocks().contains(block.getType()) && !sign.onBlockBreak(block, player, ess))
|
||||
{
|
||||
LOGGER.log(Level.INFO, "A block was protected by a sign.");
|
||||
ess.getLogger().log(Level.INFO, "A block was protected by a sign.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ public class EssentialsUpdate extends JavaPlugin
|
||||
{
|
||||
if (!getDataFolder().exists() && !getDataFolder().mkdirs())
|
||||
{
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Could not create data folder: {0}", getDataFolder().getPath());
|
||||
getLogger().log(Level.SEVERE, "Could not create data folder: {0}", getDataFolder().getPath());
|
||||
}
|
||||
essentialsHelp = new EssentialsHelp(this);
|
||||
essentialsHelp.registerEvents();
|
||||
@@ -33,7 +33,7 @@ public class EssentialsUpdate extends JavaPlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
Bukkit.getLogger().info("Essentials is ready for installation. Join the game and follow the instructions.");
|
||||
getLogger().info("Essentials is ready for installation. Join the game and follow the instructions.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@ public class UpdateCheck
|
||||
{
|
||||
if (new File(plugin.getDataFolder().getParentFile(), "Essentials.jar").exists())
|
||||
{
|
||||
Bukkit.getLogger().severe("Essentials.jar found, but not recognized by Bukkit. Broken download?");
|
||||
plugin.getLogger().severe("Essentials.jar found, but not recognized by Bukkit. Broken download?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class UpdateFile
|
||||
{
|
||||
private final static Logger LOGGER = Bukkit.getLogger();
|
||||
private final static String UPDATE_URL = "http://goo.gl/67jev";
|
||||
private final static BigInteger PUBLIC_KEY = new BigInteger(
|
||||
"5ha6a2d4qdy17ttkg8evh74sl5a87djojwenu12k1lvy8ui6003e6l06rntczpoh99mhc3txj8mqlxw111oyy9yl7s7qpyluyzix3j1odxrxx4u52gxvyu6qiteapczkzvi7rxgeqsozz7b19rdx73a7quo9ybwpz1cr82r7x5k0pg2a73pjjsv2j1awr13azo7klrcxp9y5xxwf5qv1s3tw4zqftli18u0ek5qkbzfbgk1v5n2f11pkwwk6p0mibrn26wnjbv11vyiqgu95o7busmt6vf5q7grpcenl637w83mbin56s3asj1131b2mscj9xep3cbj7la9tgsxl5bj87vzy8sk2d34kzwqdqgh9nry43nqqus12l1stmiv184r8r3jcy8w43e8h1u1mzklldb5eytkuhayqik8l3ns04hwt8sgacvw534be8sx26qrn5s1",
|
||||
@@ -37,12 +36,12 @@ public class UpdateFile
|
||||
{
|
||||
if (file.exists() && !file.delete())
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, "Could not delete file update.yml!");
|
||||
plugin.getLogger().log(Level.SEVERE, "Could not delete file update.yml!");
|
||||
return;
|
||||
}
|
||||
if (!downloadFile() || !checkFile())
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, "Could not download and verify file update.yml!");
|
||||
plugin.getLogger().log(Level.SEVERE, "Could not download and verify file update.yml!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +51,7 @@ public class UpdateFile
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, "Could not load update.yml!");
|
||||
plugin.getLogger().log(Level.SEVERE, "Could not load update.yml!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +68,7 @@ public class UpdateFile
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, "Error while downloading update.yml", ex);
|
||||
plugin.getLogger().log(Level.SEVERE, "Error while downloading update.yml", ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -163,7 +162,7 @@ public class UpdateFile
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
|
||||
plugin.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -176,7 +175,7 @@ public class UpdateFile
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
|
||||
plugin.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@@ -43,7 +43,7 @@ public class UpdateProcess implements Listener
|
||||
{
|
||||
currentPlayer.sendMessage("A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
|
||||
}
|
||||
Bukkit.getLogger().log(Level.INFO, "A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
|
||||
plugin.getLogger().log(Level.INFO, "A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
|
||||
new SelfUpdate(
|
||||
new AbstractWorkListener(plugin, updateCheck.getNewVersionInfo())
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public class UpdateProcess implements Listener
|
||||
}
|
||||
if (message != null && !message.isEmpty())
|
||||
{
|
||||
Bukkit.getLogger().log(Level.INFO, message);
|
||||
plugin.getLogger().log(Level.INFO, message);
|
||||
}
|
||||
UpdateProcess.this.currentPlayer = null;
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private static EssentialsXMPP instance = null;
|
||||
private UserManager users;
|
||||
private XMPPManager xmpp;
|
||||
@@ -40,7 +39,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
|
||||
ess = plugin.getEssentials();
|
||||
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||
}
|
||||
if (!plugin.isEnabled())
|
||||
{
|
||||
|
@@ -3,6 +3,7 @@ package net.ess3.xmpp;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.logging.*;
|
||||
import net.ess3.api.IEssentials;
|
||||
import net.ess3.api.IReload;
|
||||
import net.ess3.api.IUser;
|
||||
import net.ess3.utils.FormatUtil;
|
||||
@@ -17,7 +18,6 @@ import org.jivesoftware.smack.util.StringUtils;
|
||||
|
||||
public final class XMPPManager extends Handler implements MessageListener, ChatManagerListener, IReload
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private static final SimpleFormatter formatter = new SimpleFormatter();
|
||||
private YamlConfiguration config = null;
|
||||
private XMPPConnection connection;
|
||||
@@ -98,7 +98,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
final String server = config.getString("xmpp.server");
|
||||
if (server == null || server.equals("example.com"))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "config broken for xmpp");
|
||||
parent.getLogger().log(Level.WARNING, "config broken for xmpp");
|
||||
return false;
|
||||
}
|
||||
final int port = config.getInt("xmpp.port", 5222);
|
||||
@@ -109,7 +109,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
final StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append("Connecting to xmpp server ").append(server).append(":").append(port);
|
||||
stringBuilder.append(" as user ").append(xmppuser).append(".");
|
||||
LOGGER.log(Level.INFO, stringBuilder.toString());
|
||||
parent.getLogger().log(Level.INFO, stringBuilder.toString());
|
||||
connConf.setSASLAuthenticationEnabled(config.getBoolean("xmpp.sasl-enabled", false));
|
||||
connConf.setSendPresence(true);
|
||||
connConf.setReconnectionAllowed(true);
|
||||
@@ -125,7 +125,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
}
|
||||
catch (XMPPException ex)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to connect to server: " + server, ex);
|
||||
parent.getLogger().log(Level.WARNING, "Failed to connect to server: " + server, ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
@Override
|
||||
public void onReload()
|
||||
{
|
||||
LOGGER.removeHandler(this);
|
||||
parent.getLogger().removeHandler(this);
|
||||
config = YamlConfiguration.loadConfiguration(new File(parent.getDataFolder(), "config.yml"));
|
||||
synchronized (chats)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
}
|
||||
if (config.getBoolean("log-enabled", false))
|
||||
{
|
||||
LOGGER.addHandler(this);
|
||||
parent.getLogger().addHandler(this);
|
||||
logUsers = config.getStringList("log-users");
|
||||
final String level = config.getString("log-level", "info");
|
||||
try
|
||||
@@ -271,14 +271,14 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
catch (XMPPException ex)
|
||||
{
|
||||
failedUsers.add(user);
|
||||
LOGGER.removeHandler(XMPPManager.this);
|
||||
LOGGER.log(Level.SEVERE, "Failed to deliver log message! Disabling logging to XMPP.", ex);
|
||||
parent.getLogger().removeHandler(XMPPManager.this);
|
||||
parent.getLogger().log(Level.SEVERE, "Failed to deliver log message! Disabling logging to XMPP.", ex);
|
||||
}
|
||||
}
|
||||
logUsers.removeAll(failedUsers);
|
||||
if (logUsers.isEmpty())
|
||||
{
|
||||
LOGGER.removeHandler(XMPPManager.this);
|
||||
parent.getLogger().removeHandler(XMPPManager.this);
|
||||
threadrunning = false;
|
||||
}
|
||||
copy.clear();
|
||||
@@ -292,7 +292,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
threadrunning = false;
|
||||
}
|
||||
}
|
||||
LOGGER.removeHandler(XMPPManager.this);
|
||||
parent.getLogger().removeHandler(XMPPManager.this);
|
||||
}
|
||||
});
|
||||
loggerThread.start();
|
||||
@@ -333,7 +333,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
}
|
||||
catch (XMPPException ex)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to send xmpp message.", ex);
|
||||
parent.getLogger().log(Level.WARNING, "Failed to send xmpp message.", ex);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -357,7 +357,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
|
||||
parent.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user