mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-22 14:23:09 +02:00
More logging!
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user