From b14432329aebc11743854b799ab9378549190222 Mon Sep 17 00:00:00 2001 From: Guillermo Robles Date: Fri, 17 Dec 2021 17:33:33 +0100 Subject: [PATCH] Add support for ALL argument in enableLog function - Fixes: #1928 --- src/NetscriptFunctions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index c4eb0bb3f..406d62cb9 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -754,7 +754,12 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { } }, enableLog: function (fn: any): any { - if (possibleLogs[fn] === undefined) { + if (fn === "ALL") { + for (fn in possibleLogs) { + delete workerScript.disableLogs[fn]; + } + workerScript.log("enableLog", () => `Enabled logging for all functions`); + } else if (possibleLogs[fn] === undefined) { throw makeRuntimeErrorMsg("enableLog", `Invalid argument: ${fn}.`); } delete workerScript.disableLogs[fn];