Skip to content

Commit 950460e

Browse files
committed
Fix error logging
1 parent 2912332 commit 950460e

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/main/java/com/gamerforea/eventhelper/config/ConfigUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ else if (annotationType == ConfigEnum.class)
214214
}
215215
catch (IllegalArgumentException e)
216216
{
217-
e.printStackTrace();
217+
EventHelper.LOGGER.error("Enum value " + valueName + " not found in " + defaultValue.getDeclaringClass(), e);
218218
}
219219
}
220220
else if (annotationType == ConfigStringCollection.class)

src/main/java/com/gamerforea/eventhelper/inject/gpp/GPPInjection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.gamerforea.eventhelper.inject.gpp;
22

3+
import com.gamerforea.eventhelper.EventHelper;
34
import com.gamerforea.eventhelper.inject.PluginInjection;
45
import com.gamerforea.eventhelper.util.InjectionUtils;
56
import net.kaikk.mc.gpp.Claim;
@@ -18,9 +19,9 @@ public static PluginInjection getInjection()
1819
{
1920
return (PluginInjection) clazz.newInstance();
2021
}
21-
catch (Throwable throwable)
22+
catch (Throwable t)
2223
{
23-
throwable.printStackTrace();
24+
EventHelper.LOGGER.error("Failed to initialize plugin integration", t);
2425
}
2526
return null;
2627
}

src/main/java/com/gamerforea/eventhelper/inject/wg/WGInjection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.gamerforea.eventhelper.inject.wg;
22

3+
import com.gamerforea.eventhelper.EventHelper;
34
import com.gamerforea.eventhelper.inject.PluginInjection;
45
import com.gamerforea.eventhelper.util.InjectionUtils;
56
import com.sk89q.worldguard.bukkit.RegionQuery;
@@ -18,9 +19,9 @@ public static PluginInjection getInjection()
1819
{
1920
return (PluginInjection) clazz.newInstance();
2021
}
21-
catch (Throwable throwable)
22+
catch (Throwable t)
2223
{
23-
throwable.printStackTrace();
24+
EventHelper.LOGGER.error("Failed to initialize plugin integration", t);
2425
}
2526
return null;
2627
}

src/main/java/com/gamerforea/eventhelper/util/InjectionUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.gamerforea.eventhelper.util;
22

3+
import com.gamerforea.eventhelper.EventHelper;
34
import com.google.common.io.ByteStreams;
45
import org.bukkit.Bukkit;
56
import org.bukkit.plugin.Plugin;
@@ -23,9 +24,9 @@ public static Class<?> injectClass(String pluginName, Class<?> clazz)
2324
byte[] bytes = ByteStreams.toByteArray(in);
2425
return (Class<?>) defineClass.invoke(plugin.getClass().getClassLoader(), null, bytes, 0, bytes.length);
2526
}
26-
catch (Throwable throwable)
27+
catch (Throwable t)
2728
{
28-
throwable.printStackTrace();
29+
EventHelper.LOGGER.error("Failed to inject class " + clazz, t);
2930
return null;
3031
}
3132
}

0 commit comments

Comments
 (0)