From 9f179646cec027d1ed1068f95637117bba8a4535 Mon Sep 17 00:00:00 2001 From: Zoey76 <zoey_76@msn.com> Date: Sun, 26 Jul 2015 16:55:23 -0300 Subject: [PATCH] Initial Datapack part for logger rework --- L2J_DataPack/.classpath | 1 + .../data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java | 4 ++-- .../data/scripts/hellbound/HellboundPointData.java | 10 +++++----- .../game/data/scripts/hellbound/HellboundSpawns.java | 8 ++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/L2J_DataPack/.classpath b/L2J_DataPack/.classpath index cd1f3e2aa6..befc01be4c 100644 --- a/L2J_DataPack/.classpath +++ b/L2J_DataPack/.classpath @@ -4,5 +4,6 @@ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" /> <classpathentry combineaccessrules="false" kind="src" path="/L2J_Server" /> <classpathentry kind="lib" path="/L2J_Server/dist/libs/mmocore.jar" /> + <classpathentry kind="lib" path="/L2J_Server/dist/libs/slf4j-api-1.7.12.jar" /> <classpathentry kind="output" path="bin" /> </classpath> \ No newline at end of file diff --git a/L2J_DataPack/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java b/L2J_DataPack/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java index 042b6de657..014e2e8836 100644 --- a/L2J_DataPack/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java +++ b/L2J_DataPack/dist/game/data/scripts/ai/npc/NpcBuffers/NpcBuffersData.java @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; -import java.util.logging.Level; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; @@ -32,6 +31,7 @@ import com.l2jserver.gameserver.model.StatsSet; import com.l2jserver.util.data.xml.IXmlReader; /** + * NPC Buffers data. * @author UnAfraid */ public class NpcBuffersData implements IXmlReader @@ -47,7 +47,7 @@ public class NpcBuffersData implements IXmlReader public void load() { parseDatapackFile("data/scripts/ai/npc/NpcBuffers/NpcBuffersData.xml"); - LOGGER.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _npcBuffers.size() + " buffers data."); + LOGGER.info("{}: Loaded: {} buffers data.", getClass().getSimpleName(), _npcBuffers.size()); } @Override diff --git a/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundPointData.java b/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundPointData.java index 20b87b2d8c..477c0304d1 100644 --- a/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundPointData.java +++ b/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundPointData.java @@ -45,7 +45,7 @@ public final class HellboundPointData implements IXmlReader { _pointsInfo.clear(); parseDatapackFile("data/scripts/hellbound/hellboundTrustPoints.xml"); - LOGGER.info(getClass().getSimpleName() + ": Loaded " + _pointsInfo.size() + " trust point reward data."); + LOGGER.info("{}: Loaded {} trust point reward data.", getClass().getSimpleName(), _pointsInfo.size()); } @Override @@ -75,7 +75,7 @@ public final class HellboundPointData implements IXmlReader Node att = attrs.getNamedItem("id"); if (att == null) { - LOGGER.severe(getClass().getSimpleName() + ": Missing NPC ID, skipping record!"); + LOGGER.error("{}: Missing NPC ID, skipping record!", getClass().getSimpleName()); return; } @@ -83,7 +83,7 @@ public final class HellboundPointData implements IXmlReader att = attrs.getNamedItem("points"); if (att == null) { - LOGGER.severe("[Hellbound Trust Points Info] Missing reward point info for NPC ID " + npcId + ", skipping record"); + LOGGER.error("{}: Missing reward point info for NPC ID {}, skipping record", getClass().getSimpleName(), npcId); return; } @@ -91,7 +91,7 @@ public final class HellboundPointData implements IXmlReader att = attrs.getNamedItem("minHellboundLvl"); if (att == null) { - LOGGER.severe("[Hellbound Trust Points Info] Missing minHellboundLvl info for NPC ID " + npcId + ", skipping record"); + LOGGER.error("{}: Missing minHellboundLvl info for NPC ID {}, skipping record!", getClass().getSimpleName()); return; } @@ -99,7 +99,7 @@ public final class HellboundPointData implements IXmlReader att = attrs.getNamedItem("maxHellboundLvl"); if (att == null) { - LOGGER.severe("[Hellbound Trust Points Info] Missing maxHellboundLvl info for NPC ID " + npcId + ", skipping record"); + LOGGER.error("{}: Missing maxHellboundLvl info for NPC ID {}, skipping record!", getClass().getSimpleName(), npcId); return; } diff --git a/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundSpawns.java b/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundSpawns.java index a56ac8ab4e..14e3005e9e 100644 --- a/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundSpawns.java +++ b/L2J_DataPack/dist/game/data/scripts/hellbound/HellboundSpawns.java @@ -52,7 +52,7 @@ public final class HellboundSpawns implements IXmlReader _spawns.clear(); _spawnLevels.clear(); parseDatapackFile("data/scripts/hellbound/hellboundSpawns.xml"); - LOGGER.info(getClass().getSimpleName() + ": Loaded " + _spawns.size() + " Hellbound spawns."); + LOGGER.info("{}: Loaded {} Hellbound spawns.", getClass().getSimpleName(), _spawns.size()); } @Override @@ -81,7 +81,7 @@ public final class HellboundSpawns implements IXmlReader final Node id = npc.getAttributes().getNamedItem("id"); if (id == null) { - LOGGER.severe(getClass().getSimpleName() + ": Missing NPC ID, skipping record!"); + LOGGER.error("{}: Missing NPC ID, skipping record!", getClass().getSimpleName()); return; } @@ -124,7 +124,7 @@ public final class HellboundSpawns implements IXmlReader spawn.setAmount(1); if (loc == null) { - LOGGER.warning("Hellbound spawn location is null!"); + LOGGER.warn("{}: Hellbound spawn location is null!", getClass().getSimpleName()); } spawn.setLocation(loc); spawn.setRespawnDelay(delay, randomInterval); @@ -138,7 +138,7 @@ public final class HellboundSpawns implements IXmlReader } catch (SecurityException | ClassNotFoundException | NoSuchMethodException e) { - LOGGER.warning(getClass().getSimpleName() + ": Couldn't load spawns: " + e.getMessage()); + LOGGER.warn("{}: Couldn't load spawns!", getClass().getSimpleName(), e); } } } -- GitLab