Fix Logging

This commit is contained in:
Kam committed 2025-07-23 05:13:11 -04:00
1 parent 39e51bc8c2
commit b60d6f8eb5
3 files changed
+10 -2

No files matched your search

@@ -33,6 +33,8 @@ public class ConfigDebug {
public static Property ScriptLogIgnoreTypeProperty;
public static String ScriptLogIgnoreType = "TICK";
public static boolean LogActionManager = false;
public static void init(File configFile) {
config = new Configuration(configFile);
@@ -59,6 +61,9 @@ public class ConfigDebug {
"INIT,TICK,INTERACT,DIALOG,DAMAGED,KILLED,ATTACK,TARGET,COLLIDE,KILLS,DIALOG_CLOSE,TIMER");
ScriptLogIgnoreType = ScriptLogIgnoreTypeProperty.getString();
LogActionManager = config.get(LOGGING, "Log Action Manager", LogActionManager, "Log the Performance of the Action Manager").getBoolean(LogActionManager);
// Convert to Legacy
if (CustomNpcs.legacyExist) {
PlayerLogging = LegacyConfig.PlayerLogging;
@@ -3,6 +3,8 @@ package noppes.npcs.controllers.data.action;
import noppes.npcs.LogWriter;
import noppes.npcs.api.handler.data.IAction;
import noppes.npcs.api.handler.data.IActionQueue;
import noppes.npcs.config.ConfigDebug;
import noppes.npcs.config.ConfigScript;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
@@ -136,7 +138,8 @@ public class ActionLogger {
private static final String ANSI_RESET = "\u001B[0m";
public void println(String str) {
System.out.printf("[%tT] %s[%s]:%s %s%s%n", new Date(), ANSI_CYAN, Thread.currentThread().getName(), ANSI_GOLD, str, ANSI_RESET);
if(ConfigDebug.LogActionManager)
System.out.printf("[%tT] %s[%s]:%s %s%s%n", new Date(), ANSI_CYAN, Thread.currentThread().getName(), ANSI_GOLD, str, ANSI_RESET);
}
// public ActionLogger beginTick1(ActionManager manager) {
@@ -35,7 +35,7 @@ public class ActionManager implements IActionManager {
protected final ActionQueue conditionalQueue = new ActionQueue(this, "mainConditional", true);
protected final Map<String, IActionQueue> otherQueues = new HashMap<>();
protected boolean debug;
protected boolean debug = false;
protected ScriptContainer reportTo;
public ActionManager() {}