Merge pull request #1982 from wynro/add-ALL-to-enableLog

Add support for ALL argument in enableLog function
This commit is contained in:
hydroflame 2021-12-18 14:39:44 -05:00 committed by GitHub
commit 0ff110492e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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];