Fixed tprintf also printing the file name

This commit is contained in:
Bart Koppelmans 2021-11-20 20:54:31 +01:00 committed by GitHub
parent 7255ce24ef
commit b6b191bdbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -696,22 +696,22 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
const str = vsprintf(format, args); const str = vsprintf(format, args);
if (str.startsWith("ERROR") || str.startsWith("FAIL")) { if (str.startsWith("ERROR") || str.startsWith("FAIL")) {
Terminal.error(`${workerScript.scriptRef.filename}: ${str}`); Terminal.error(`${str}`);
return; return;
} }
if (str.startsWith("SUCCESS")) { if (str.startsWith("SUCCESS")) {
Terminal.success(`${workerScript.scriptRef.filename}: ${str}`); Terminal.success(`${str}`);
return; return;
} }
if (str.startsWith("WARN")) { if (str.startsWith("WARN")) {
Terminal.warn(`${workerScript.scriptRef.filename}: ${str}`); Terminal.warn(`${str}`);
return; return;
} }
if (str.startsWith("INFO")) { if (str.startsWith("INFO")) {
Terminal.info(`${workerScript.scriptRef.filename}: ${str}`); Terminal.info(`${str}`);
return; return;
} }
Terminal.print(`${workerScript.scriptRef.filename}: ${str}`); Terminal.print(`${str}`);
}, },
clearLog: function (): any { clearLog: function (): any {
workerScript.scriptRef.clearLog(); workerScript.scriptRef.clearLog();