Skip to content
Snippets Groups Projects
Commit 9f179646 authored by Zoey76's avatar Zoey76
Browse files

Initial Datapack part for logger rework

parent 00a5a237
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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
......
......@@ -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;
}
......
......@@ -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);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment